chore(storage): add assertion to list buckets test
@@ -266,11 +266,13 @@ func TestListBucketsEmulated(t *testing.T) {
want = want[:2]
var err error
var b *BucketAttrs
+ var got int
for i := 0; err == nil && i <= len(want); i++ {
b, err = it.Next()
if err != nil {
break
}
+ got++
if diff := cmp.Diff(b.Name, want[i].Name); diff != "" {
t.Errorf("got(-),want(+):\n%s", diff)
}
@@ -278,6 +280,10 @@ func TestListBucketsEmulated(t *testing.T) {
if err != iterator.Done {
t.Fatalf("expected %q but got %q", iterator.Done, err)
}
+ expected := len(want)
+ if got != expected {
+ t.Errorf("expected to get %d buckets, but got %d", expected, got)
+ }
})
}
