Use assert.ElementsMatch instead of manually copying+sorting
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
1fa3161756
commit
ee94e88cdd
|
|
@ -2,7 +2,6 @@ package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"archive/tar"
|
"archive/tar"
|
||||||
"sort"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/containers/storage/pkg/archive"
|
"github.com/containers/storage/pkg/archive"
|
||||||
|
|
@ -62,10 +61,7 @@ func TestCheckDirectory(t *testing.T) {
|
||||||
cd.header(&hdr)
|
cd.header(&hdr)
|
||||||
}
|
}
|
||||||
actual := cd.names()
|
actual := cd.names()
|
||||||
sort.Strings(actual)
|
assert.ElementsMatch(t, vectors[i].expected, actual)
|
||||||
expected := append([]string{}, vectors[i].expected...)
|
|
||||||
sort.Strings(expected)
|
|
||||||
assert.Equal(t, expected, actual)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue