MCPcopy
hub / github.com/stretchr/testify / FailNow

Function FailNow

assert/assertions.go:345–363  ·  assert/assertions.go::FailNow

FailNow fails test

(t TestingT, failureMessage string, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

343
344// FailNow fails test
345func 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
366func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool {

Callers 5

FailNowFunction · 0.92
FailNowfFunction · 0.70
FailNowMethod · 0.70

Calls 3

FailFunction · 0.70
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by 2