Commit 01b13d79 authored by Jan Mercl's avatar Jan Mercl

Add test for PR4.

parent 852c8585
......@@ -1330,3 +1330,20 @@ func TestSeek(t *testing.T) {
}
}
}
func TestPR4(t *testing.T) {
tr := TreeNew(cmp)
for i := 0; i < 2*kd+1; i++ {
k := 1000 * i
tr.Set(k, nil)
}
tr.Delete(1000 * kd)
for i := 0; i < kd; i++ {
tr.Set(1000*(kd+1)-1-i, nil)
}
k := 1000*(kd+1) - 1 - kd
tr.Set(k, nil)
if _, ok := tr.Get(k); !ok {
t.Fatalf("key lost: %v", k)
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment