EqualErrorf asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction() assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
(t TestingT, theError error, errString string, msg string, args ...interface{})
| 184 | // actualObj, err := SomeFunction() |
| 185 | // assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") |
| 186 | func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) { |
| 187 | if h, ok := t.(tHelper); ok { |
| 188 | h.Helper() |
| 189 | } |
| 190 | if assert.EqualErrorf(t, theError, errString, msg, args...) { |
| 191 | return |
| 192 | } |
| 193 | t.FailNow() |
| 194 | } |
| 195 | |
| 196 | // EqualExportedValues asserts that the types of two objects are equal and their public |
| 197 | // fields are also equal. This is useful for comparing structs that have private fields |
no test coverage detected
searching dependent graphs…