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