EqualError asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction() assert.EqualError(t, err, expectedErrorString)
(t TestingT, theError error, errString string, msgAndArgs ...interface{})
| 169 | // actualObj, err := SomeFunction() |
| 170 | // assert.EqualError(t, err, expectedErrorString) |
| 171 | func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) { |
| 172 | if h, ok := t.(tHelper); ok { |
| 173 | h.Helper() |
| 174 | } |
| 175 | if assert.EqualError(t, theError, errString, msgAndArgs...) { |
| 176 | return |
| 177 | } |
| 178 | t.FailNow() |
| 179 | } |
| 180 | |
| 181 | // EqualErrorf asserts that a function returned an error (i.e. not `nil`) |
| 182 | // and that it is equal to the provided error. |
searching dependent graphs…