MCPcopy
hub / github.com/pterm/pterm / testDoesNotOutput

Function testDoesNotOutput

utils_test.go:197–202  ·  view source on GitHub ↗

testDoesNotOutput can be used, to test that something does not output anything to stdout.

(t *testing.T, logic func(w io.Writer))

Source from the content-addressed store, hash-verified

195
196// testDoesNotOutput can be used, to test that something does not output anything to stdout.
197func testDoesNotOutput(t *testing.T, logic func(w io.Writer)) {
198 testza.AssertZero(t, captureStdout(logic))
199 pterm.DisableStyling()
200 testza.AssertZero(t, captureStdout(logic))
201 pterm.EnableStyling()
202}
203
204var outBuf bytes.Buffer
205

Calls 3

DisableStylingFunction · 0.92
EnableStylingFunction · 0.92
captureStdoutFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…