(t *testing.T, buf *strings.Builder, expect string)
| 9 | ) |
| 10 | |
| 11 | func expectBuffer(t *testing.T, buf *strings.Builder, expect string) { |
| 12 | t.Helper() |
| 13 | current := strings.TrimSpace(buf.String()) |
| 14 | if current != expect { |
| 15 | r := strings.NewReplacer("\r", "\\R", "\n", "\\N") |
| 16 | current, expect = r.Replace(current), r.Replace(expect) |
| 17 | t.Fatalf("Render mismatch\nResult: '%s'\nExpect: '%s'\n", current, expect) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | func TestRegression(t *testing.T) { |
| 22 | buf := strings.Builder{} |
no test coverage detected