(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestCommandStdin(t *testing.T) { |
| 84 | const expect = "Hello you\nGoodbye me" |
| 85 | ctx := log.Testing(t) |
| 86 | stdin := bytes.NewBufferString("1 Hello to you\n2 Goodbye from me\n") |
| 87 | output, _ := shell.Command("awk", `{ print $2 " " $4 }`).Read(stdin).Call(ctx) |
| 88 | assert.For(ctx, "output").ThatString(output).Equals(expect) |
| 89 | } |
| 90 | |
| 91 | func TestCommandCall(t *testing.T) { |
| 92 | const expect = "echo to stdout" |