aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-10-13 22:38:47 -0700
committerChris Lu <chris.lu@gmail.com>2021-10-13 22:38:47 -0700
commit46a09c60744eff104fdfc1a1fade38c5485f0dda (patch)
tree8d9fd39f18158d179dea68ec7cee76a20a645fc5
parent4cbd390fbe634e2370c36a61b1574e9d648c3cee (diff)
downloadseaweedfs-46a09c60744eff104fdfc1a1fade38c5485f0dda.tar.xz
seaweedfs-46a09c60744eff104fdfc1a1fade38c5485f0dda.zip
adjust test
-rw-r--r--weed/util/skiplist/skiplist_test.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/weed/util/skiplist/skiplist_test.go b/weed/util/skiplist/skiplist_test.go
index 7ce7b4843..5b36cacbd 100644
--- a/weed/util/skiplist/skiplist_test.go
+++ b/weed/util/skiplist/skiplist_test.go
@@ -2,7 +2,6 @@ package skiplist
import (
"bytes"
- "fmt"
"math/rand"
"strconv"
"testing"
@@ -243,9 +242,8 @@ func TestFindGreaterOrEqual(t *testing.T) {
key := Element(rand.Intn(maxNumber))
if _, v, ok, _ := list.FindGreaterOrEqual(key); ok {
// if f is v should be bigger than the element before
- if v.Prev != nil && bytes.Compare(v.Prev.Key, key) >= 0 {
- fmt.Printf("PrevV: %s\n key: %s\n\n", string(v.Prev.Key), string(key))
- t.Fail()
+ if v.Prev != nil && bytes.Compare(key, v.Prev.Key) < 0 {
+ t.Errorf("PrevV: %s\n key: %s\n\n", string(v.Prev.Key), string(key))
}
// v should be bigger or equal to f
// If we compare directly, we get an equal key with a difference on the 10th decimal point, which fails.