From 521eb55d1e9523c1dba61ab68b6ef9ebc1cf3e53 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Fri, 26 May 2023 09:41:23 -0700 Subject: [PATCH] test: better message for different empty slices (#6920) Given two empty slices, one that is equal to nil and one that is not, AssertDeepEquals used to produce this confusing output: [[]] !(deep)= [[]] After this change, it produces: [[]string(nil)] !(deep)= [[]string{}] --- test/asserts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/asserts.go b/test/asserts.go index 25a32eaee..56fae831d 100644 --- a/test/asserts.go +++ b/test/asserts.go @@ -118,7 +118,7 @@ func AssertEquals(t *testing.T, one interface{}, two interface{}) { func AssertDeepEquals(t *testing.T, one interface{}, two interface{}) { t.Helper() if !reflect.DeepEqual(one, two) { - t.Fatalf("[%+v] !(deep)= [%+v]", one, two) + t.Fatalf("[%#v] !(deep)= [%#v]", one, two) } }