MCPcopy Create free account
hub / github.com/stretchr/testify / FailNow

Function FailNow

assert/assertions.go:327–345  ·  view source on GitHub ↗

FailNow fails test

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

Source from the content-addressed store, hash-verified

325
326// FailNow fails test
327func 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
348func 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