(t *testing.T, wantErr string)
| 482 | } |
| 483 | |
| 484 | func checkForPanic(t *testing.T, wantErr string) { |
| 485 | t.Helper() |
| 486 | r := recover() |
| 487 | if r == nil { |
| 488 | t.Fatalf("Use after free did not panic") |
| 489 | } |
| 490 | if msg, ok := r.(string); !ok || msg != wantErr { |
| 491 | t.Fatalf("panic called with %v, want %s", r, wantErr) |
| 492 | } |
| 493 | } |
no test coverage detected