mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-22 03:20:07 +08:00
adjust test
This commit is contained in:
@@ -2,7 +2,6 @@ package skiplist
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -243,9 +242,8 @@ func TestFindGreaterOrEqual(t *testing.T) {
|
|||||||
key := Element(rand.Intn(maxNumber))
|
key := Element(rand.Intn(maxNumber))
|
||||||
if _, v, ok, _ := list.FindGreaterOrEqual(key); ok {
|
if _, v, ok, _ := list.FindGreaterOrEqual(key); ok {
|
||||||
// if f is v should be bigger than the element before
|
// if f is v should be bigger than the element before
|
||||||
if v.Prev != nil && bytes.Compare(v.Prev.Key, key) >= 0 {
|
if v.Prev != nil && bytes.Compare(key, v.Prev.Key) < 0 {
|
||||||
fmt.Printf("PrevV: %s\n key: %s\n\n", string(v.Prev.Key), string(key))
|
t.Errorf("PrevV: %s\n key: %s\n\n", string(v.Prev.Key), string(key))
|
||||||
t.Fail()
|
|
||||||
}
|
}
|
||||||
// v should be bigger or equal to f
|
// 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.
|
// If we compare directly, we get an equal key with a difference on the 10th decimal point, which fails.
|
||||||
|
|||||||
Reference in New Issue
Block a user