MCPcopy Create free account
hub / github.com/go-task/task / TestIncludedVarsMultiLevel

Function TestIncludedVarsMultiLevel

task_test.go:2452–2475  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2450}
2451
2452func TestIncludedVarsMultiLevel(t *testing.T) {
2453 t.Parallel()
2454
2455 const dir = "testdata/include_with_vars_multi_level"
2456 var buff bytes.Buffer
2457 e := task.NewExecutor(
2458 task.WithDir(dir),
2459 task.WithStdout(&buff),
2460 task.WithStderr(&buff),
2461 )
2462 require.NoError(t, e.Setup())
2463
2464 expectedOutputOrder := strings.TrimSpace(`
2465task: [lib:greet] echo 'Hello world'
2466Hello world
2467task: [foo:lib:greet] echo 'Hello foo'
2468Hello foo
2469task: [bar:lib:greet] echo 'Hello bar'
2470Hello bar
2471`)
2472 require.NoError(t, e.Run(t.Context(), &task.Call{Task: "default"}))
2473 t.Log(buff.String())
2474 assert.Equal(t, expectedOutputOrder, strings.TrimSpace(buff.String()))
2475}
2476
2477func TestErrorCode(t *testing.T) {
2478 t.Parallel()

Callers

nothing calls this directly

Calls 3

SetupMethod · 0.95
RunMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…