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

Method PanicsWithError

require/require_forward.go:1481–1486  ·  view source on GitHub ↗

PanicsWithError asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value is an error that satisfies the EqualError comparison. a.PanicsWithError("crazy error", func(){ GoCrazy() })

(errString string, f assert.PanicTestFunc, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1479//
1480// a.PanicsWithError("crazy error", func(){ GoCrazy() })
1481func (a *Assertions) PanicsWithError(errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
1482 if h, ok := a.t.(tHelper); ok {
1483 h.Helper()
1484 }
1485 PanicsWithError(a.t, errString, f, msgAndArgs...)
1486}
1487
1488// PanicsWithErrorf asserts that the code inside the specified PanicTestFunc
1489// panics, and that the recovered panic value is an error that satisfies the

Callers

nothing calls this directly

Calls 2

PanicsWithErrorFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected