ErrorContainsf asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := SomeFunction() assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
(t TestingT, theError error, contains string, msg string, args ...interface{})
| 339 | // actualObj, err := SomeFunction() |
| 340 | // assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") |
| 341 | func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) { |
| 342 | if h, ok := t.(tHelper); ok { |
| 343 | h.Helper() |
| 344 | } |
| 345 | if assert.ErrorContainsf(t, theError, contains, msg, args...) { |
| 346 | return |
| 347 | } |
| 348 | t.FailNow() |
| 349 | } |
| 350 | |
| 351 | // ErrorIs asserts that at least one of the errors in err's chain matches target. |
| 352 | // This is a wrapper for errors.Is. |
no test coverage detected
searching dependent graphs…