MCPcopy
hub / github.com/pterm/pterm / TestPrint

Function TestPrint

print_test.go:51–72  ·  view source on GitHub ↗

Print functions

(t *testing.T)

Source from the content-addressed store, hash-verified

49// Print functions
50
51func TestPrint(t *testing.T) {
52 t.Run("enabled output", func(t *testing.T) {
53 pterm.Output = true
54 for _, randomString := range internal.RandomStrings {
55 out := captureStdout(func(w io.Writer) {
56 pterm.Print(randomString)
57 })
58 testza.AssertEqual(t, randomString, out)
59 }
60 })
61
62 t.Run("disabled output", func(t *testing.T) {
63 pterm.Output = false
64 for _, randomString := range internal.RandomStrings {
65 out := captureStdout(func(w io.Writer) {
66 pterm.Print(randomString)
67 })
68 testza.AssertEqual(t, "", out)
69 }
70 pterm.Output = true
71 })
72}
73
74func TestPrintln(t *testing.T) {
75 t.Run("enabled output", func(t *testing.T) {

Callers

nothing calls this directly

Calls 2

PrintFunction · 0.92
captureStdoutFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…