mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-12 15:17:16 +03:00
parent
50001bf172
commit
0cb58facef
@ -74,7 +74,7 @@ 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" {
|
||||
if len(b) != 2 || !anyItemPresentWithKey(b, "bar") || !anyItemPresentWithKey(b, "barbar") {
|
||||
t.Errorf("b-prefix incorrect: %q", b)
|
||||
}
|
||||
|
||||
@ -89,3 +89,13 @@ func TestSetExpiring(t *testing.T) {
|
||||
t.Error("not len 0 after clear")
|
||||
}
|
||||
}
|
||||
|
||||
func anyItemPresentWithKey(items []Item, key string) bool {
|
||||
for _, item := range items {
|
||||
if item.Key() == key {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user