MCPcopy
hub / github.com/stretchr/testify / NotPanics

Function NotPanics

require/require.go:1707–1715  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1705//
1706// require.NotPanics(t, func(){ RemainCalm() })
1707func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
1708 if h, ok := t.(tHelper); ok {
1709 h.Helper()
1710 }
1711 if assert.NotPanics(t, f, msgAndArgs...) {
1712 return
1713 }
1714 t.FailNow()
1715}
1716
1717// NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic.
1718//

Calls 3

NotPanicsFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65