testSprintContainsWithoutError can be used to test Sprint methods which return an error.
(t *testing.T, logic func(a any) (string, error))
| 117 | |
| 118 | // testSprintContainsWithoutError can be used to test Sprint methods which return an error. |
| 119 | func testSprintContainsWithoutError(t *testing.T, logic func(a any) (string, error)) { |
| 120 | for _, printable := range printables { |
| 121 | t.Run(fmt.Sprint(printable), func(t *testing.T) { |
| 122 | s, err := logic(printable) |
| 123 | testza.AssertContains(t, s, fmt.Sprint(printable)) |
| 124 | testza.AssertNoError(t, err) |
| 125 | }) |
| 126 | pterm.DisableStyling() |
| 127 | t.Run(fmt.Sprint(printable), func(t *testing.T) { |
| 128 | s, err := logic(printable) |
| 129 | testza.AssertContains(t, s, fmt.Sprint(printable)) |
| 130 | testza.AssertNoError(t, err) |
| 131 | }) |
| 132 | pterm.EnableStyling() |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | // testSprintfContains can be used to test Sprintf methods. |
| 137 | func testSprintfContains(t *testing.T, logic func(format string, a any) string) { |
no test coverage detected
searching dependent graphs…