(t *testing.T)
| 221 | } |
| 222 | |
| 223 | func TestPipelineStderr(t *testing.T) { |
| 224 | t.Parallel() |
| 225 | ctx := context.Background() |
| 226 | |
| 227 | dir, err := ioutil.TempDir("", "pipeline-test-") |
| 228 | require.NoError(t, err) |
| 229 | defer os.RemoveAll(dir) |
| 230 | |
| 231 | p := pipe.New(pipe.WithDir(dir)) |
| 232 | p.Add(pipe.Command("ls", "doesnotexist")) |
| 233 | |
| 234 | _, err = p.Output(ctx) |
| 235 | if assert.Error(t, err) { |
| 236 | assert.Contains(t, err.Error(), "ls: exit status") |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | func TestPipelineInterrupted(t *testing.T) { |
| 241 | if runtime.GOOS == "windows" { |