MCPcopy
hub / github.com/pterm/pterm / testDoesOutput

Function testDoesOutput

utils_test.go:179–184  ·  view source on GitHub ↗

testDoesOutput can be used to test if something is outputted to stdout.

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

Source from the content-addressed store, hash-verified

177
178// testDoesOutput can be used to test if something is outputted to stdout.
179func testDoesOutput(t *testing.T, logic func(w io.Writer)) {
180 testza.AssertNotZero(t, captureStdout(logic))
181 pterm.DisableStyling()
182 testza.AssertNotZero(t, captureStdout(logic))
183 pterm.EnableStyling()
184}
185
186// testEmpty checks that a function does not return a string.
187func testEmpty(t *testing.T, logic func(a any) string) {

Callers

nothing calls this directly

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…