assertContains checks that the output contains the expected substring.
(t *testing.T, output string, substr string)
| 198 | |
| 199 | // assertContains checks that the output contains the expected substring. |
| 200 | func assertContains(t *testing.T, output string, substr string) { |
| 201 | t.Helper() |
| 202 | if !strings.Contains(output, substr) { |
| 203 | t.Errorf("expected output to contain %q, but it does not.\nOutput:\n%s", substr, output) |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | // assertNotContains checks that the output does NOT contain the substring. |
| 208 | func assertNotContains(t *testing.T, output string, substr string) { |
no outgoing calls
no test coverage detected