(t *testing.T)
| 17 | } |
| 18 | |
| 19 | func TestParagraphPrinterPrintMethods(t *testing.T) { |
| 20 | p := pterm.DefaultParagraph |
| 21 | |
| 22 | t.Run("Print", func(t *testing.T) { |
| 23 | testPrintContains(t, func(w io.Writer, a any) { |
| 24 | p.Print(a) |
| 25 | }) |
| 26 | }) |
| 27 | |
| 28 | t.Run("PrintWithLongText", func(t *testing.T) { |
| 29 | proxyToDevNull() |
| 30 | testza.AssertNotZero(t, p.Print("This is a longer text to test the paragraph printer. I don't know when this text will be long enough so I will just write until I get the feeling that it's enough. Maybe about now.")) |
| 31 | }) |
| 32 | |
| 33 | t.Run("PrintWithoutText", func(t *testing.T) { |
| 34 | proxyToDevNull() |
| 35 | testza.AssertNotZero(t, p.Print("")) |
| 36 | }) |
| 37 | |
| 38 | t.Run("Printf", func(t *testing.T) { |
| 39 | testPrintfContains(t, func(w io.Writer, format string, a any) { |
| 40 | p.Printf(format, a) |
| 41 | }) |
| 42 | }) |
| 43 | |
| 44 | t.Run("Printfln", func(t *testing.T) { |
| 45 | testPrintflnContains(t, func(w io.Writer, format string, a any) { |
| 46 | p.Printfln(format, a) |
| 47 | }) |
| 48 | }) |
| 49 | |
| 50 | t.Run("Println", func(t *testing.T) { |
| 51 | testPrintlnContains(t, func(w io.Writer, a any) { |
| 52 | p.Println(a) |
| 53 | }) |
| 54 | }) |
| 55 | |
| 56 | t.Run("Sprint", func(t *testing.T) { |
| 57 | testSprintContains(t, func(a any) string { |
| 58 | return p.Sprint(a) |
| 59 | }) |
| 60 | }) |
| 61 | |
| 62 | t.Run("Sprintf", func(t *testing.T) { |
| 63 | testSprintfContains(t, func(format string, a any) string { |
| 64 | return p.Sprintf(format, a) |
| 65 | }) |
| 66 | }) |
| 67 | |
| 68 | t.Run("Sprintfln", func(t *testing.T) { |
| 69 | testSprintflnContains(t, func(format string, a any) string { |
| 70 | return p.Sprintfln(format, a) |
| 71 | }) |
| 72 | }) |
| 73 | |
| 74 | t.Run("Sprintln", func(t *testing.T) { |
| 75 | testSprintlnContains(t, func(a any) string { |
| 76 | return p.Sprintln(a) |
nothing calls this directly
no test coverage detected
searching dependent graphs…