aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-10-13 20:42:16 -0700
committerChris Lu <chris.lu@gmail.com>2021-10-13 20:42:20 -0700
commit4cbd390fbe634e2370c36a61b1574e9d648c3cee (patch)
treeb6f44b3de09bfd3a56f0e5481c77fabc4f2eb67d
parentb693a8d6b95ad70cfa2e0943f1ff78bd8776fcd9 (diff)
downloadseaweedfs-4cbd390fbe634e2370c36a61b1574e9d648c3cee.tar.xz
seaweedfs-4cbd390fbe634e2370c36a61b1574e9d648c3cee.zip
test: add fail message
-rw-r--r--weed/util/skiplist/skiplist_test.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/weed/util/skiplist/skiplist_test.go b/weed/util/skiplist/skiplist_test.go
index e423e8b27..7ce7b4843 100644
--- a/weed/util/skiplist/skiplist_test.go
+++ b/weed/util/skiplist/skiplist_test.go
@@ -230,7 +230,7 @@ func TestFindGreaterOrEqual(t *testing.T) {
// Test on empty list.
if _, _, ok, _ := listPointer.FindGreaterOrEqual(Element(0)); ok {
- t.Fail()
+ t.Errorf("found element 0 in an empty list")
}
list = New(memStore)
@@ -250,16 +250,14 @@ func TestFindGreaterOrEqual(t *testing.T) {
// 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 bytes.Compare(v.Key, key) < 0 {
- fmt.Printf("v: %s\n key: %s\n\n", string(v.Key), string(key))
- t.Fail()
+ t.Errorf("v: %s\n key: %s\n\n", string(v.Key), string(key))
}
} else {
lastNode, _ := list.GetLargestNode()
lastV := lastNode.GetValue()
// It is OK, to fail, as long as f is bigger than the last element.
if bytes.Compare(key, lastV) <= 0 {
- fmt.Printf("lastV: %s\n key: %s\n\n", string(lastV), string(key))
- t.Fail()
+ t.Errorf("lastV: %s\n key: %s\n\n", string(lastV), string(key))
}
}
}