Equalf asserts that two objects are equal. assert.Equalf(t, 123, 123, "error message %s", "formatted") Pointer variable equality is determined based on the equality of the referenced values (as opposed to the memory addresses). Function equality cannot be determined and will always fail.
(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{})
| 69 | // referenced values (as opposed to the memory addresses). Function equality |
| 70 | // cannot be determined and will always fail. |
| 71 | func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { |
| 72 | if h, ok := t.(tHelper); ok { |
| 73 | h.Helper() |
| 74 | } |
| 75 | return Equal(t, expected, actual, append([]interface{}{msg}, args...)...) |
| 76 | } |
| 77 | |
| 78 | // EqualErrorf asserts that a function returned an error (i.e. not `nil`) |
| 79 | // and that it is equal to the provided error. |