Print functions
(t *testing.T)
| 49 | // Print functions |
| 50 | |
| 51 | func 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 | |
| 74 | func TestPrintln(t *testing.T) { |
| 75 | t.Run("enabled output", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…