set: Fix test flake

This commit is contained in:
Andrey Petrov 2016-09-09 12:16:19 -04:00
parent a22d9380e4
commit 9ecd2a6fa2

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 {