MCPcopy
hub / github.com/go-task/task / TestSplitArgs

Function TestSplitArgs

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

Source from the content-addressed store, hash-verified

2759}
2760
2761func TestSplitArgs(t *testing.T) {
2762 t.Parallel()
2763
2764 var buff bytes.Buffer
2765 e := task.NewExecutor(
2766 task.WithDir("testdata/split_args"),
2767 task.WithStdout(&buff),
2768 task.WithStderr(&buff),
2769 task.WithSilent(true),
2770 )
2771 require.NoError(t, e.Setup())
2772
2773 vars := ast.NewVars()
2774 vars.Set("CLI_ARGS", ast.Var{Value: "foo bar 'foo bar baz'"})
2775
2776 err := e.Run(t.Context(), &task.Call{Task: "default", Vars: vars})
2777 require.NoError(t, err)
2778 assert.Equal(t, "3\n", buff.String())
2779}
2780
2781func TestAbsPath(t *testing.T) {
2782 t.Parallel()

Callers

nothing calls this directly

Calls 5

SetupMethod · 0.95
SetMethod · 0.95
RunMethod · 0.95
NewVarsFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…