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

Function ObjectsAreEqual

assert/assertions.go:64–82  ·  assert/assertions.go::ObjectsAreEqual

* Helper functions */ ObjectsAreEqual determines if two objects are considered equal. This function does no assertion of any kind.

(expected, actual interface{})

Source from the content-addressed store, hash-verified

62//
63// This function does no assertion of any kind.
64func ObjectsAreEqual(expected, actual interface{}) bool {
65 if expected == nil || actual == nil {
66 return expected == actual
67 }
68
69 exp, ok := expected.([]byte)
70 if !ok {
71 return reflect.DeepEqual(expected, actual)
72 }
73
74 act, ok := actual.([]byte)
75 if !ok {
76 return false
77 }
78 if exp == nil || act == nil {
79 return exp == nil && act == nil
80 }
81 return bytes.Equal(exp, act)
82}
83
84// copyExportedFields iterates downward through nested data structures and creates a copy
85// that only contains the exported struct fields.

Callers 12

DiffMethod · 0.92
assertOptsFunction · 0.92
TestObjectsAreEqualFunction · 0.85
TestBytesEqualFunction · 0.85
ObjectsAreEqualValuesFunction · 0.85
isTypeFunction · 0.85
EqualFunction · 0.85
NotEqualFunction · 0.85
containsElementFunction · 0.85
SubsetFunction · 0.85
NotSubsetFunction · 0.85
diffListsFunction · 0.85

Calls 1

EqualMethod · 0.45

Tested by 2

TestObjectsAreEqualFunction · 0.68
TestBytesEqualFunction · 0.68