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

Function Panics

internal/testify/assert/assertions.go:1214–1224  ·  view source on GitHub ↗

Panics asserts that the code inside the specified PanicTestFunc panics. assert.Panics(t, func(){ GoCrazy() })

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

Source from the content-addressed store, hash-verified

1212//
1213// assert.Panics(t, func(){ GoCrazy() })
1214func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
1215 if h, ok := t.(tHelper); ok {
1216 h.Helper()
1217 }
1218
1219 if funcDidPanic, panicValue, _ := didPanic(f); !funcDidPanic {
1220 return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...)
1221 }
1222
1223 return true
1224}
1225
1226// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
1227// the recovered panic value equals the expected panic value.

Callers 7

PanicsFunction · 0.92
PanicsfFunction · 0.70
TestPanicsFunction · 0.70
PanicsMethod · 0.70

Calls 4

didPanicFunction · 0.85
SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45

Tested by 4

TestPanicsFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…