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

Function PanicsWithErrorf

assert/assertion_format.go:753–758  ·  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. assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")

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

Source from the content-addressed store, hash-verified

751//
752// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
753func PanicsWithErrorf(t TestingT, errString string, f PanicTestFunc, msg string, args ...interface{}) bool {
754 if h, ok := t.(tHelper); ok {
755 h.Helper()
756 }
757 return PanicsWithError(t, errString, f, append([]interface{}{msg}, args...)...)
758}
759
760// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that
761// the recovered panic value equals the expected panic value.

Callers 2

PanicsWithErrorfFunction · 0.92
PanicsWithErrorfMethod · 0.70

Calls 2

PanicsWithErrorFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected