NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. assert.NotPanics(t, func(){ RemainCalm() })
(t TestingT, f PanicTestFunc, msgAndArgs ...interface{})
| 1355 | // |
| 1356 | // assert.NotPanics(t, func(){ RemainCalm() }) |
| 1357 | func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { |
| 1358 | if h, ok := t.(tHelper); ok { |
| 1359 | h.Helper() |
| 1360 | } |
| 1361 | |
| 1362 | if funcDidPanic, panicValue, panickedStack := didPanic(f); funcDidPanic { |
| 1363 | return Fail(t, fmt.Sprintf("func %#v should not panic\n\tPanic value:\t%v\n\tPanic stack:\t%s", f, panicValue, panickedStack), msgAndArgs...) |
| 1364 | } |
| 1365 | |
| 1366 | return true |
| 1367 | } |
| 1368 | |
| 1369 | // WithinDuration asserts that the two times are within duration delta of each other. |
| 1370 | // |
searching dependent graphs…