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

Function TestExitCodeZero

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

Source from the content-addressed store, hash-verified

2281}
2282
2283func TestExitCodeZero(t *testing.T) {
2284 t.Parallel()
2285
2286 const dir = "testdata/exit_code"
2287 var buff bytes.Buffer
2288 e := task.NewExecutor(
2289 task.WithDir(dir),
2290 task.WithStdout(&buff),
2291 task.WithStderr(&buff),
2292 )
2293 require.NoError(t, e.Setup())
2294
2295 require.NoError(t, e.Run(t.Context(), &task.Call{Task: "exit-zero"}))
2296 assert.Equal(t, "FOO=bar - DYNAMIC_FOO=bar - EXIT_CODE=", strings.TrimSpace(buff.String()))
2297}
2298
2299func TestExitCodeOne(t *testing.T) {
2300 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…