EqualErrorf asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction() require.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
(t TestingT, theError error, errString string, msg string, args ...interface{})
| 201 | // actualObj, err := SomeFunction() |
| 202 | // require.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") |
| 203 | func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) { |
| 204 | if h, ok := t.(tHelper); ok { |
| 205 | h.Helper() |
| 206 | } |
| 207 | if assert.EqualErrorf(t, theError, errString, msg, args...) { |
| 208 | return |
| 209 | } |
| 210 | t.FailNow() |
| 211 | } |
| 212 | |
| 213 | // EqualExportedValues asserts that the types of two objects are equal and their public |
| 214 | // fields are also equal. This is useful for comparing structs that have private fields |
no test coverage detected