(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestStylePrinterPrintMethods(t *testing.T) { |
| 16 | p := pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold) |
| 17 | |
| 18 | t.Run("Print", func(t *testing.T) { |
| 19 | testPrintContains(t, func(w io.Writer, a any) { |
| 20 | p.Print(a) |
| 21 | }) |
| 22 | }) |
| 23 | |
| 24 | t.Run("Printf", func(t *testing.T) { |
| 25 | testPrintfContains(t, func(w io.Writer, format string, a any) { |
| 26 | p.Printf(format, a) |
| 27 | }) |
| 28 | }) |
| 29 | |
| 30 | t.Run("Printfln", func(t *testing.T) { |
| 31 | testPrintflnContains(t, func(w io.Writer, format string, a any) { |
| 32 | p.Printfln(format, a) |
| 33 | }) |
| 34 | }) |
| 35 | |
| 36 | t.Run("Println", func(t *testing.T) { |
| 37 | testPrintlnContains(t, func(w io.Writer, a any) { |
| 38 | p.Println(a) |
| 39 | }) |
| 40 | }) |
| 41 | |
| 42 | t.Run("Sprint", func(t *testing.T) { |
| 43 | testSprintContains(t, func(a any) string { |
| 44 | return p.Sprint(a) |
| 45 | }) |
| 46 | }) |
| 47 | |
| 48 | t.Run("Sprintf", func(t *testing.T) { |
| 49 | testSprintfContains(t, func(format string, a any) string { |
| 50 | return p.Sprintf(format, a) |
| 51 | }) |
| 52 | }) |
| 53 | |
| 54 | t.Run("Sprintfln", func(t *testing.T) { |
| 55 | testSprintflnContains(t, func(format string, a any) string { |
| 56 | return p.Sprintfln(format, a) |
| 57 | }) |
| 58 | }) |
| 59 | |
| 60 | t.Run("Sprintln", func(t *testing.T) { |
| 61 | testSprintlnContains(t, func(a any) string { |
| 62 | return p.Sprintln(a) |
| 63 | }) |
| 64 | }) |
| 65 | } |
| 66 | |
| 67 | func TestRemoveColorFromString(t *testing.T) { |
| 68 | for _, randomString := range internal.RandomStrings { |
nothing calls this directly
no test coverage detected
searching dependent graphs…