MCPcopy Index your code
hub / github.com/go-task/task / TestExpand

Function TestExpand

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

Source from the content-addressed store, hash-verified

953}
954
955func TestExpand(t *testing.T) {
956 t.Parallel()
957
958 const dir = "testdata/expand"
959
960 home, err := os.UserHomeDir()
961 if err != nil {
962 t.Errorf("Couldn't get $HOME: %v", err)
963 }
964 var buff bytes.Buffer
965
966 e := task.NewExecutor(
967 task.WithDir(dir),
968 task.WithStdout(&buff),
969 task.WithStderr(&buff),
970 )
971 require.NoError(t, e.Setup())
972 require.NoError(t, e.Run(t.Context(), &task.Call{Task: "pwd"}))
973 assert.Equal(t, home, strings.TrimSpace(buff.String()))
974}
975
976func TestDry(t *testing.T) {
977 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…