MCPcopy Create free account
hub / github.com/stretchr/testify / PanicsWithErrorf

Function PanicsWithErrorf

assert/assertion_format.go:732–737  ·  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

730//
731// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
732func PanicsWithErrorf(t TestingT, errString string, f PanicTestFunc, msg string, args ...interface{}) bool {
733 if h, ok := t.(tHelper); ok {
734 h.Helper()
735 }
736 return PanicsWithError(t, errString, f, append([]interface{}{msg}, args...)...)
737}
738
739// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that
740// 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