From a7e65ca27f9902ae5e249376592aa7496cafb34e Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 18 Jul 2023 14:35:29 +0200 Subject: [PATCH] Added support for slice comparison --- Equal.go | 2 +- Equal_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Equal.go b/Equal.go index 9bc4776..7ea45f6 100644 --- a/Equal.go +++ b/Equal.go @@ -26,7 +26,7 @@ func NotEqual[T comparable](t testing.TB, a T, b T) { } // DeepEqual asserts that the two parameters are deeply equal. -func DeepEqual[T comparable](t testing.TB, a T, b T) { +func DeepEqual[T any](t testing.TB, a T, b T) { if reflect.DeepEqual(a, b) { return } diff --git a/Equal_test.go b/Equal_test.go index 8149c0c..64fe1ea 100644 --- a/Equal_test.go +++ b/Equal_test.go @@ -24,6 +24,7 @@ func TestNotEqual(t *testing.T) { func TestDeepEqual(t *testing.T) { assert.DeepEqual(t, 0, 0) assert.DeepEqual(t, "Hello", "Hello") + assert.DeepEqual(t, []byte("Hello"), []byte("Hello")) assert.DeepEqual(t, T{A: 10}, T{A: 10}) assert.DeepEqual(t, &T{A: 10}, &T{A: 10}) }