(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestCommandCaptureStderr(t *testing.T) { |
| 76 | const expect = "print to stderr\n" |
| 77 | ctx := log.Testing(t) |
| 78 | buf := &bytes.Buffer{} |
| 79 | shell.Command("awk", `END {print "print to stderr" > "/dev/stderr"}`).Capture(nil, buf).Run(ctx) |
| 80 | assert.For(ctx, "buf").ThatString(buf).Equals(expect) |
| 81 | } |
| 82 | |
| 83 | func TestCommandStdin(t *testing.T) { |
| 84 | const expect = "Hello you\nGoodbye me" |