fix AssertDeepEqual

This commit is contained in:
Robin Willmann 2023-09-21 14:14:51 +02:00
parent cd9406900a
commit 6e6797eac5

View File

@ -21,14 +21,14 @@ func AssertNotEqual[T comparable](t *testing.T, actual T, expected T) {
} }
} }
func AssertDeepEqual[T comparable](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)
} }
} }
func AssertNotDeepEqual[T comparable](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)