MCPcopy
hub / github.com/grpc/grpc-go / checkForPanic

Function checkForPanic

mem/buffers_test.go:484–493  ·  view source on GitHub ↗
(t *testing.T, wantErr string)

Source from the content-addressed store, hash-verified

482}
483
484func 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}

Calls 1

FatalfMethod · 0.65

Tested by

no test coverage detected