MCPcopy Index your code
hub / github.com/expr-lang/expr / PanicsWithErrorf

Function PanicsWithErrorf

internal/testify/require/require.go:1772–1780  ·  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 assert.PanicTestFunc, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

1770//
1771// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
1772func PanicsWithErrorf(t TestingT, errString string, f assert.PanicTestFunc, msg string, args ...interface{}) {
1773 if h, ok := t.(tHelper); ok {
1774 h.Helper()
1775 }
1776 if assert.PanicsWithErrorf(t, errString, f, msg, args...) {
1777 return
1778 }
1779 t.FailNow()
1780}
1781
1782// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
1783// the recovered panic value equals the expected panic value.

Callers 1

PanicsWithErrorfMethod · 0.70

Calls 3

PanicsWithErrorfFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…