| 2281 | } |
| 2282 | |
| 2283 | func 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 | |
| 2299 | func TestExitCodeOne(t *testing.T) { |
| 2300 | t.Parallel() |