Ensure object count doesn't change suring sorting

This commit is contained in:
Júlio César Batista 2022-11-30 11:26:12 -08:00
parent abcfa7cb24
commit 61f4e1172a
No known key found for this signature in database
GPG key ID: 10C4B861BF314878

View file

@ -71,6 +71,10 @@ func TestSortObjects(t *testing.T) {
sortObjects(allObjects)
if len(allObjects) != len(expectedOrder) {
t.Fatal("number of objects changed while sorting")
}
for i := 0; i < len(allObjects); i++ {
if allObjects[i].GetID() != expectedOrder[i].GetID() {
t.Fatalf("object order differs at index %d, got '%s' expected '%s'", i, allObjects[i].GetID(), expectedOrder[i].GetID())