mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-13 07:37:17 +03:00
set: Fix test flake
This commit is contained in:
parent
a22d9380e4
commit
9ecd2a6fa2
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user