MCPcopy
hub / github.com/stretchr/testify / TestDidPanicWrapper

Function TestDidPanicWrapper

assert/forward_assertions_test.go:260–274  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

258}
259
260func TestDidPanicWrapper(t *testing.T) {
261 t.Parallel()
262
263 if funcDidPanic, _, _ := didPanic(func() {
264 panic("Panic!")
265 }); !funcDidPanic {
266 t.Error("didPanic should return true")
267 }
268
269 if funcDidPanic, _, _ := didPanic(func() {
270 }); funcDidPanic {
271 t.Error("didPanic should return false")
272 }
273
274}
275
276func TestPanicsWrapper(t *testing.T) {
277 t.Parallel()

Callers

nothing calls this directly

Calls 2

didPanicFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected