MCPcopy
hub / github.com/stretchr/testify / Equal

Function Equal

require/require.go:173–181  ·  view source on GitHub ↗

Equal asserts that two objects are equal. require.Equal(t, 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.

(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

171// referenced values (as opposed to the memory addresses). Function equality
172// cannot be determined and will always fail.
173func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
174 if h, ok := t.(tHelper); ok {
175 h.Helper()
176 }
177 if assert.Equal(t, expected, actual, msgAndArgs...) {
178 return
179 }
180 t.FailNow()
181}
182
183// EqualError asserts that a function returned an error (i.e. not `nil`)
184// and that it is equal to the provided error.

Callers 15

Test_Mock_UnsetFunction · 0.92
Test_Mock_ReturnFunction · 0.92
Test_Mock_PanicFunction · 0.92
Test_Mock_Return_AfterFunction · 0.92
Test_Mock_Return_RunFunction · 0.92
Test_Mock_Return_OnceFunction · 0.92
Test_Mock_Return_TwiceFunction · 0.92
Test_Mock_Return_TimesFunction · 0.92
Test_Mock_Return_NothingFunction · 0.92

Calls 3

EqualFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by 15

Test_Mock_UnsetFunction · 0.74
Test_Mock_ReturnFunction · 0.74
Test_Mock_PanicFunction · 0.74
Test_Mock_Return_AfterFunction · 0.74
Test_Mock_Return_RunFunction · 0.74
Test_Mock_Return_OnceFunction · 0.74
Test_Mock_Return_TwiceFunction · 0.74
Test_Mock_Return_TimesFunction · 0.74
Test_Mock_Return_NothingFunction · 0.74