From b5b9d24dc38c63cca6319f2b139cb9b35b3cb058 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Wed, 24 Jul 2024 10:32:38 +0000 Subject: encoding: use slices and maps to clean up tests Replace reflect.DeepEqual with slices.Equal/maps.Equal, which is much faster. Change-Id: I62ad60a66e28cfb2bb49c36037bafd4b9d201e88 GitHub-Last-Rev: 79554baddb1856260a44ba6587c205d223a527b1 GitHub-Pull-Request: golang/go#67611 Reviewed-on: https://go-review.googlesource.com/c/go/+/587818 LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- src/encoding/csv/reader_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/encoding/csv/reader_test.go') diff --git a/src/encoding/csv/reader_test.go b/src/encoding/csv/reader_test.go index 2e5d62330c..0be236a52f 100644 --- a/src/encoding/csv/reader_test.go +++ b/src/encoding/csv/reader_test.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "reflect" + "slices" "strings" "testing" "unicode/utf8" @@ -470,7 +471,7 @@ func TestRead(t *testing.T) { } break } - if got, want := rec, tt.Output[recNum]; !reflect.DeepEqual(got, want) { + if got, want := rec, tt.Output[recNum]; !slices.Equal(got, want) { t.Errorf("Read vs ReadAll mismatch;\ngot %q\nwant %q", got, want) } pos := positions[recNum] -- cgit v1.3-5-g9baa