Commit 7f4ea073 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3888b637
...@@ -478,19 +478,48 @@ def test_zwalkBFS(): ...@@ -478,19 +478,48 @@ def test_zwalkBFS():
assert _[0].range == R(-inf, inf) assert _[0].range == R(-inf, inf)
assert T(_[0].node) == (BTREE_NORMAL, [4]) assert T(_[0].node) == (BTREE_NORMAL, [4])
_ = zwalkv[1] # [-∞,4)T2, [4,∞)T _ = zwalkv[1] # [-∞,4)T2, [4,∞)T
assert len(_) == 2 assert len(_) == 2
assert _[0].range == R(-inf, 4) assert _[0].range == R(-inf, 4)
assert T(_[0].node) == (BTREE_NORMAL, [2])
assert _[1].range == R(4, inf) assert _[1].range == R(4, inf)
assert T(_[0].node) == (BTREE_NORMAL, [2])
assert T(_[1].node) == (BTREE_NORMAL, []) assert T(_[1].node) == (BTREE_NORMAL, [])
_ = zwalkv[2] # [-∞,2)T, [2,4)T, [4,∞)T6,10 _ = zwalkv[2] # [-∞,2)T, [2,4)T, [4,∞)T6,10
assert len(_) == 3 assert len(_) == 3
assert _[0].range == R(-inf,2)
assert _[1].range == R(2,4)
# XXX assert _[2].range == R(4,inf)
assert T(_[0].node) == (BTREE_ONE, B1)
assert T(_[1].node) == (BTREE_ONE, B3)
assert T(_[2].node) == (BTREE_NORMAL, [6,10])
_ = zwalkv[3] # [-∞,2)B1, [2,4)B3, [4,6)T, [6,10)T, [10,∞]T
assert len(_) == 5
assert _[0].range == R(-inf,2)
assert _[1].range == R(2,4)
assert _[2].range == R(4,6)
assert _[3].range == R(6,10)
assert _[4].range == R(10,inf)
assert B(_[0].node) == [1]
assert B(_[1].node) == [3]
assert T(_[2].node) == (BTREE_NORMAL, [])
assert T(_[3].node) == (BTREE_ONE, B7)
assert T(_[4].node) == (BTREE_ONE, B11)
_ = zwalkv[4] # [4,6)T, [6,10)B7, [10,∞)B11
assert len(_) == 3
assert _[0].range == R(4,6)
assert _[1].range == R(6,10)
assert _[2].range == R(10,inf)
assert T(_[0].node) == (BTREE_ONE, B5)
assert B(_[1].node) == [7]
assert B(_[2].node) == [11]
_ = zwalkv[5] # [4,6)B5
assert len(_) == 1
assert _[0].range == R(4,6)
assert B(_[0].node) == [5]
def test_keyvSliceBy(): def test_keyvSliceBy():
......
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