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{})
| 150 | // actualObj, err := SomeFunction() |
| 151 | // assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") |
| 152 | func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool { |
| 153 | if h, ok := t.(tHelper); ok { |
| 154 | h.Helper() |
| 155 | } |
| 156 | return ErrorContains(t, theError, contains, append([]interface{}{msg}, args...)...) |
| 157 | } |
| 158 | |
| 159 | // ErrorIsf asserts that at least one of the errors in err's chain matches target. |
| 160 | // This is a wrapper for errors.Is. |
no test coverage detected