DeepEqual fails a test if the actual does not deeply equal the expected
(t *testing.T, a, b interface{}, message string)
| 94 | |
| 95 | // DeepEqual fails a test if the actual does not deeply equal the expected |
| 96 | func 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 |
| 111 | func EqualJSON(t *testing.T, a, b, message string) { |