From ee94e88cddfa76156a184f8b23c93aa8e29dccef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 4 Sep 2024 20:49:23 +0200 Subject: [PATCH] Use assert.ElementsMatch instead of manually copying+sorting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- check_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/check_test.go b/check_test.go index 2b37cf3e1..35a942542 100644 --- a/check_test.go +++ b/check_test.go @@ -2,7 +2,6 @@ package storage import ( "archive/tar" - "sort" "testing" "github.com/containers/storage/pkg/archive" @@ -62,10 +61,7 @@ func TestCheckDirectory(t *testing.T) { cd.header(&hdr) } actual := cd.names() - sort.Strings(actual) - expected := append([]string{}, vectors[i].expected...) - sort.Strings(expected) - assert.Equal(t, expected, actual) + assert.ElementsMatch(t, vectors[i].expected, actual) }) } }