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

Function TestPipelineSingleCommandWithStdout

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

Source from the content-addressed store, hash-verified

69}
70
71func TestPipelineSingleCommandWithStdout(t *testing.T) {
72 t.Parallel()
73 ctx := context.Background()
74
75 stdout := &bytes.Buffer{}
76
77 p := pipe.New(pipe.WithStdout(stdout))
78 p.Add(pipe.Command("echo", "hello world"))
79 if assert.NoError(t, p.Run(ctx)) {
80 assert.Equal(t, "hello world\n", stdout.String())
81 }
82}
83
84func TestNontrivialPipeline(t *testing.T) {
85 t.Parallel()

Callers

nothing calls this directly

Calls 6

NewFunction · 0.92
WithStdoutFunction · 0.92
CommandFunction · 0.92
RunMethod · 0.80
AddMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected