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

Function NotPanics

internal/testify/assert/assertions.go:1271–1281  ·  view source on GitHub ↗

NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. assert.NotPanics(t, func(){ RemainCalm() })

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

Source from the content-addressed store, hash-verified

1269//
1270// assert.NotPanics(t, func(){ RemainCalm() })
1271func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
1272 if h, ok := t.(tHelper); ok {
1273 h.Helper()
1274 }
1275
1276 if funcDidPanic, panicValue, panickedStack := didPanic(f); funcDidPanic {
1277 return Fail(t, fmt.Sprintf("func %#v should not panic\n\tPanic value:\t%v\n\tPanic stack:\t%s", f, panicValue, panickedStack), msgAndArgs...)
1278 }
1279
1280 return true
1281}
1282
1283// WithinDuration asserts that the two times are within duration delta of each other.
1284//

Callers 7

NotPanicsFunction · 0.92
NotPanicsfFunction · 0.70
TestNotPanicsFunction · 0.70
TestEventuallyTimeoutFunction · 0.70
NotPanicsMethod · 0.70

Calls 4

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

Tested by 4

TestNotPanicsFunction · 0.56
TestEventuallyTimeoutFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…