(t *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestNontrivialPipeline(t *testing.T) { |
| 85 | t.Parallel() |
| 86 | ctx := context.Background() |
| 87 | |
| 88 | p := pipe.New() |
| 89 | p.Add( |
| 90 | pipe.Command("echo", "hello world"), |
| 91 | pipe.Command("sed", "s/hello/goodbye/"), |
| 92 | ) |
| 93 | out, err := p.Output(ctx) |
| 94 | if assert.NoError(t, err) { |
| 95 | assert.EqualValues(t, "goodbye world\n", out) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | func TestPipelineReadFromSlowly(t *testing.T) { |
| 100 | t.Parallel() |