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

Function TestIncludedTaskfileVarMerging

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

Source from the content-addressed store, hash-verified

1645}
1646
1647func TestIncludedTaskfileVarMerging(t *testing.T) {
1648 t.Parallel()
1649
1650 const dir = "testdata/included_taskfile_var_merging"
1651 tests := []struct {
1652 name string
1653 task string
1654 expectedOutput string
1655 }{
1656 {"foo", "foo:pwd", "included_taskfile_var_merging/foo\n"},
1657 {"bar", "bar:pwd", "included_taskfile_var_merging/bar\n"},
1658 }
1659 for _, test := range tests {
1660 t.Run(test.name, func(t *testing.T) {
1661 t.Parallel()
1662
1663 var buff bytes.Buffer
1664 e := task.NewExecutor(
1665 task.WithDir(dir),
1666 task.WithStdout(&buff),
1667 task.WithStderr(&buff),
1668 task.WithSilent(true),
1669 )
1670 require.NoError(t, e.Setup())
1671
1672 err := e.Run(t.Context(), &task.Call{Task: test.task})
1673 require.NoError(t, err)
1674 assert.Contains(t, filepath.ToSlash(buff.String()), test.expectedOutput)
1675 })
1676 }
1677}
1678
1679func TestInternalTask(t *testing.T) {
1680 t.Parallel()

Callers

nothing calls this directly

Calls 4

SetupMethod · 0.95
RunMethod · 0.95
RunMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…