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

Method PanicsWithErrorf

assert/assertion_forward.go:1492–1497  ·  view source on GitHub ↗

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

(errString string, f PanicTestFunc, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

1490//
1491// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
1492func (a *Assertions) PanicsWithErrorf(errString string, f PanicTestFunc, msg string, args ...interface{}) bool {
1493 if h, ok := a.t.(tHelper); ok {
1494 h.Helper()
1495 }
1496 return PanicsWithErrorf(a.t, errString, f, msg, args...)
1497}
1498
1499// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
1500// the recovered panic value equals the expected panic value.

Callers

nothing calls this directly

Calls 2

PanicsWithErrorfFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected