(t *testing.T)
| 352 | } |
| 353 | |
| 354 | func TestExecSendsStderrOutputToPipeStderr(t *testing.T) { |
| 355 | t.Parallel() |
| 356 | buf := new(bytes.Buffer) |
| 357 | out, err := script.NewPipe().WithStderr(buf).Exec("go").String() |
| 358 | if err == nil { |
| 359 | t.Fatal("want error when command returns a non-zero exit status") |
| 360 | } |
| 361 | if out != "" { |
| 362 | t.Fatalf("unexpected output: %q", out) |
| 363 | } |
| 364 | if !strings.Contains(buf.String(), "Usage") { |
| 365 | t.Errorf("want stderr output containing the word 'Usage', got %q", buf.String()) |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | func TestFilterByCopyPassesInputThroughUnchanged(t *testing.T) { |
| 370 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…