MCPcopy
hub / github.com/go-task/task / TestGroupErrorOnlyShowsOutputOnError

Function TestGroupErrorOnlyShowsOutputOnError

internal/output/output_test.go:108–122  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestGroupErrorOnlyShowsOutputOnError(t *testing.T) {
109 t.Parallel()
110
111 var b bytes.Buffer
112 var o output.Output = output.Group{
113 ErrorOnly: true,
114 }
115 stdOut, stdErr, cleanup := o.WrapWriter(&b, io.Discard, "", nil)
116
117 _, _ = fmt.Fprintln(stdOut, "std-out")
118 _, _ = fmt.Fprintln(stdErr, "std-err")
119
120 require.NoError(t, cleanup(errors.New("any-error")))
121 assert.Equal(t, "std-out\nstd-err\n", b.String())
122}
123
124func TestPrefixed(t *testing.T) { //nolint:paralleltest // cannot run in parallel
125 var b bytes.Buffer

Callers

nothing calls this directly

Calls 2

WrapWriterMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…