set: Fix test flake

This commit is contained in:
Andrey Petrov committed 2017-04-28 11:43:15 -04:00
1 parent a22d9380e4
commit 9ecd2a6fa2
1 file changed
+8 -2
+8 -2
View File
@@ -1,6 +1,7 @@
package set
import (
"strings"
"testing"
"time"
)
@@ -80,8 +81,13 @@ func TestSetExpiring(t *testing.T) {
t.Errorf("failed to get barbar: %s", err)
}
b := s.ListPrefix("b")
if len(b) != 2 || b[0].Key() != "bar" || b[1].Key() != "barbar" {
t.Errorf("b-prefix incorrect: %q", b)
if len(b) != 2 {
t.Errorf("b-prefix incorrect number of results: %d", len(b))
}
for i, item := range b {
if !strings.HasPrefix(item.Key(), "b") {
t.Errorf("item %d does not have b prefix: %s", i, item.Key())
}
}
if err := s.Remove("bar"); err != nil {