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

Function NotEqual

assert/assertions.go:882–896  ·  view source on GitHub ↗

NotEqual asserts that the specified values are NOT equal. assert.NotEqual(t, obj1, obj2) Pointer variable equality is determined based on the equality of the referenced values (as opposed to the memory addresses).

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

Source from the content-addressed store, hash-verified

880// Pointer variable equality is determined based on the equality of the
881// referenced values (as opposed to the memory addresses).
882func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
883 if h, ok := t.(tHelper); ok {
884 h.Helper()
885 }
886 if err := validateEqualArgs(expected, actual); err != nil {
887 return Fail(t, fmt.Sprintf("Invalid operation: %#v != %#v (%s)",
888 expected, actual, err), msgAndArgs...)
889 }
890
891 if ObjectsAreEqual(expected, actual) {
892 return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...)
893 }
894
895 return true
896}
897
898// NotEqualValues asserts that two objects are not equal even when converted to the same type
899//

Callers 9

TestTwoMethod · 0.92
Test_Mock_Return_AfterFunction · 0.92
Test_Mock_Return_RunFunction · 0.92
NotEqualFunction · 0.92
NotEqualfFunction · 0.70
TestNotEqualFunction · 0.70
Test_truncatingFormatFunction · 0.70
NotEqualMethod · 0.70

Calls 4

validateEqualArgsFunction · 0.85
ObjectsAreEqualFunction · 0.85
FailFunction · 0.70
HelperMethod · 0.65

Tested by 6

TestTwoMethod · 0.74
Test_Mock_Return_AfterFunction · 0.74
Test_Mock_Return_RunFunction · 0.74
TestNotEqualFunction · 0.56
Test_truncatingFormatFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…