Equal asserts that two objects are equal. a.Equal(123, 123) 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.
(expected interface{}, actual interface{}, msgAndArgs ...interface{})
| 140 | // referenced values (as opposed to the memory addresses). Function equality |
| 141 | // cannot be determined and will always fail. |
| 142 | func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { |
| 143 | if h, ok := a.t.(tHelper); ok { |
| 144 | h.Helper() |
| 145 | } |
| 146 | return Equal(a.t, expected, actual, msgAndArgs...) |
| 147 | } |
| 148 | |
| 149 | // EqualError asserts that a function returned an error (i.e. not `nil`) |
| 150 | // and that it is equal to the provided error. |