fix inversion of AssertDeepEqual

This commit is contained in:
Robin Willmann 2023-09-25 11:34:51 +02:00
parent a127b24e62
commit 4a1fb1ae18

View File

@ -23,7 +23,7 @@ func AssertNotEqual[T comparable](t *testing.T, actual T, expected T) {
func AssertDeepEqual[T any](t *testing.T, actual T, expected T) { func AssertDeepEqual[T any](t *testing.T, actual T, expected T) {
t.Helper() t.Helper()
if reflect.DeepEqual(actual, expected) { if !reflect.DeepEqual(actual, expected) {
t.Errorf("values differ: Actual: '%v', Expected: '%v'", actual, expected) t.Errorf("values differ: Actual: '%v', Expected: '%v'", actual, expected)
} }
} }
@ -48,7 +48,7 @@ func AssertSetDeepEqual[T any](t *testing.T, actual []T, expected []T) {
func AssertNotDeepEqual[T any](t *testing.T, actual T, expected T) { func AssertNotDeepEqual[T any](t *testing.T, actual T, expected T) {
t.Helper() t.Helper()
if !reflect.DeepEqual(actual, expected) { if reflect.DeepEqual(actual, expected) {
t.Errorf("values do not differ: Actual: '%v', Expected: '%v'", actual, expected) t.Errorf("values do not differ: Actual: '%v', Expected: '%v'", actual, expected)
} }
} }