MCPcopy
hub / github.com/dnote/dnote / DeepEqual

Function DeepEqual

pkg/assert/assert.go:96–108  ·  view source on GitHub ↗

DeepEqual fails a test if the actual does not deeply equal the expected

(t *testing.T, a, b interface{}, message string)

Source from the content-addressed store, hash-verified

94
95// DeepEqual fails a test if the actual does not deeply equal the expected
96func DeepEqual(t *testing.T, a, b interface{}, message string) {
97 if cmp.Equal(a, b) {
98 return
99 }
100
101 if len(message) == 0 {
102 message = fmt.Sprintf("%v != %v", a, b)
103 }
104
105 errorMessage := getErrorMessage(message, a, b)
106 errorMessage = fmt.Sprintf("%v\n%v", errorMessage, cmp.Diff(a, b))
107 t.Error(errorMessage)
108}
109
110// EqualJSON asserts that two JSON strings are equal
111func EqualJSON(t *testing.T, a, b, message string) {

Callers 15

TestDoFunction · 0.92
TestMigrateToV6Function · 0.92
TestScanTokenFunction · 0.92
TestTokenizeFunction · 0.92
TestReportConflictFunction · 0.92
TestProcessFragmentsFunction · 0.92
TestSendBooksFunction · 0.92
TestSendNotesFunction · 0.92
TestGetNotesFunction · 0.92
TestGetNoteFunction · 0.92
TestGetBooksFunction · 0.92
TestGetBooksByNameFunction · 0.92

Calls 2

getErrorMessageFunction · 0.85
ErrorMethod · 0.45

Tested by 15

TestDoFunction · 0.74
TestMigrateToV6Function · 0.74
TestScanTokenFunction · 0.74
TestTokenizeFunction · 0.74
TestReportConflictFunction · 0.74
TestProcessFragmentsFunction · 0.74
TestSendBooksFunction · 0.74
TestSendNotesFunction · 0.74
TestGetNotesFunction · 0.74
TestGetNoteFunction · 0.74
TestGetBooksFunction · 0.74
TestGetBooksByNameFunction · 0.74