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

Function PanicsWithError

internal/testify/require/require.go:1757–1765  ·  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. assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() })

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

Source from the content-addressed store, hash-verified

1755//
1756// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
1757func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
1758 if h, ok := t.(tHelper); ok {
1759 h.Helper()
1760 }
1761 if assert.PanicsWithError(t, errString, f, msgAndArgs...) {
1762 return
1763 }
1764 t.FailNow()
1765}
1766
1767// PanicsWithErrorf asserts that the code inside the specified PanicTestFunc
1768// panics, and that the recovered panic value is an error that satisfies the

Callers 1

PanicsWithErrorMethod · 0.70

Calls 3

PanicsWithErrorFunction · 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…