Skip to content

Commit

Permalink
Use assert.ElementsMatch instead of manually copying+sorting
Browse files Browse the repository at this point in the history
Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Sep 4, 2024
1 parent 72f531e commit c76bce2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package storage

import (
"archive/tar"
"sort"
"testing"

"github.com/containers/storage/pkg/archive"
Expand Down Expand Up @@ -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)
})
}
}
Expand Down

0 comments on commit c76bce2

Please sign in to comment.