NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. assert.NotPanics(t, func(){ RemainCalm() })
(t TestingT, f PanicTestFunc, msgAndArgs ...interface{})
| 1269 | // |
| 1270 | // assert.NotPanics(t, func(){ RemainCalm() }) |
| 1271 | func 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 | // |
searching dependent graphs…