FailNow fails test
(t TestingT, failureMessage string, msgAndArgs ...interface{})
| 323 | |
| 324 | // FailNow fails test |
| 325 | func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { |
| 326 | if h, ok := t.(tHelper); ok { |
| 327 | h.Helper() |
| 328 | } |
| 329 | Fail(t, failureMessage, msgAndArgs...) |
| 330 | |
| 331 | // We cannot extend TestingT with FailNow() and |
| 332 | // maintain backwards compatibility, so we fallback |
| 333 | // to panicking when FailNow is not available in |
| 334 | // TestingT. |
| 335 | // See issue #263 |
| 336 | |
| 337 | if t, ok := t.(failNower); ok { |
| 338 | t.FailNow() |
| 339 | } else { |
| 340 | panic("test failed and t is missing `FailNow()`") |
| 341 | } |
| 342 | return false |
| 343 | } |
| 344 | |
| 345 | // Fail reports a failure through |
| 346 | func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { |
searching dependent graphs…