ExpectNoDiff tests to see if the two interfaces have no diff. If there is no diff, the retrun value is true. If there is a diff, it is logged to tb and an error is flagged, and the return value is false.
(tb testing.TB, a, b interface{}, opts ...cmp.Option)
| 36 | // If there is no diff, the retrun value is true. |
| 37 | // If there is a diff, it is logged to tb and an error is flagged, and the return value is false. |
| 38 | func ExpectNoDiff(tb testing.TB, a, b interface{}, opts ...cmp.Option) bool { |
| 39 | tb.Helper() |
| 40 | if diff := Diff(a, b, opts...); diff != "" { |
| 41 | tb.Errorf("Unexpected diff, -want +got:\n%s", diff) |
| 42 | return false |
| 43 | } |
| 44 | return true |
| 45 | } |