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

Function didPanic

internal/testify/assert/assertions.go:1194–1209  ·  view source on GitHub ↗

didPanic returns true if the function passed to it panics. Otherwise, it returns false.

(f PanicTestFunc)

Source from the content-addressed store, hash-verified

1192
1193// didPanic returns true if the function passed to it panics. Otherwise, it returns false.
1194func didPanic(f PanicTestFunc) (didPanic bool, message interface{}, stack string) {
1195 didPanic = true
1196
1197 defer func() {
1198 message = recover()
1199 if didPanic {
1200 stack = string(debug.Stack())
1201 }
1202 }()
1203
1204 // call the target function
1205 f()
1206 didPanic = false
1207
1208 return
1209}
1210
1211// Panics asserts that the code inside the specified PanicTestFunc panics.
1212//

Callers 6

TestDidPanicWrapperFunction · 0.85
TestDidPanicFunction · 0.85
PanicsFunction · 0.85
PanicsWithValueFunction · 0.85
PanicsWithErrorFunction · 0.85
NotPanicsFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestDidPanicWrapperFunction · 0.68
TestDidPanicFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…