mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-15 00:20:37 +03:00
set: Fix test flake
This commit is contained in:
parent
a22d9380e4
commit
9ecd2a6fa2
@ -1,6 +1,7 @@
|
|||||||
package set
|
package set
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -80,8 +81,13 @@ func TestSetExpiring(t *testing.T) {
|
|||||||
t.Errorf("failed to get barbar: %s", err)
|
t.Errorf("failed to get barbar: %s", err)
|
||||||
}
|
}
|
||||||
b := s.ListPrefix("b")
|
b := s.ListPrefix("b")
|
||||||
if len(b) != 2 || b[0].Key() != "bar" || b[1].Key() != "barbar" {
|
if len(b) != 2 {
|
||||||
t.Errorf("b-prefix incorrect: %q", b)
|
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 {
|
if err := s.Remove("bar"); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user