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

Function TestExitCodeOne

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

Source from the content-addressed store, hash-verified

2297}
2298
2299func TestExitCodeOne(t *testing.T) {
2300 t.Parallel()
2301
2302 const dir = "testdata/exit_code"
2303 var buff bytes.Buffer
2304 e := task.NewExecutor(
2305 task.WithDir(dir),
2306 task.WithStdout(&buff),
2307 task.WithStderr(&buff),
2308 )
2309 require.NoError(t, e.Setup())
2310
2311 require.Error(t, e.Run(t.Context(), &task.Call{Task: "exit-one"}))
2312 assert.Equal(t, "FOO=bar - DYNAMIC_FOO=bar - EXIT_CODE=1", strings.TrimSpace(buff.String()))
2313}
2314
2315func TestIgnoreNilElements(t *testing.T) {
2316 t.Parallel()

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…