From 280ab7f95cdbbaf2fee4a49d10d944e2865829fc Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 4 Oct 2021 02:30:24 -0700 Subject: [PATCH] add test --- weed/util/skiplist/skiplist_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/weed/util/skiplist/skiplist_test.go b/weed/util/skiplist/skiplist_test.go index 115656cd9..a35bef6f3 100644 --- a/weed/util/skiplist/skiplist_test.go +++ b/weed/util/skiplist/skiplist_test.go @@ -16,6 +16,21 @@ var ( memStore = newMemStore() ) +func TestReverseInsert(t *testing.T) { + list := NewSeed(100, memStore) + + list.Insert([]byte("zzz"), []byte("zzz")) + list.Delete([]byte("zzz")) + + list.Insert([]byte("aaa"), []byte("aaa")) + + if list.IsEmpty() { + t.Fail() + } + +} + + func TestInsertAndFind(t *testing.T) { k0 := []byte("0")