MCPcopy
hub / github.com/github/git-sizer / TestPipelineStderr

Function TestPipelineStderr

internal/pipe/pipeline_test.go:223–238  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

221}
222
223func 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
240func TestPipelineInterrupted(t *testing.T) {
241 if runtime.GOOS == "windows" {

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
WithDirFunction · 0.92
CommandFunction · 0.92
OutputMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected