FailNow fails test
(t TestingT, failureMessage string, msgAndArgs ...interface{})
| 343 | |
| 344 | // FailNow fails test |
| 345 | func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { |
| 346 | if h, ok := t.(tHelper); ok { |
| 347 | h.Helper() |
| 348 | } |
| 349 | Fail(t, failureMessage, msgAndArgs...) |
| 350 | |
| 351 | // We cannot extend TestingT with FailNow() and |
| 352 | // maintain backwards compatibility, so we fallback |
| 353 | // to panicking when FailNow is not available in |
| 354 | // TestingT. |
| 355 | // See issue #263 |
| 356 | |
| 357 | if t, ok := t.(failNower); ok { |
| 358 | t.FailNow() |
| 359 | } else { |
| 360 | panic("test failed and t is missing `FailNow()`") |
| 361 | } |
| 362 | return false |
| 363 | } |
| 364 | |
| 365 | // Fail reports a failure through |
| 366 | func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { |