Commit 404d4ec6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6722f6b6
......@@ -601,59 +601,21 @@ def test_restructure():
# -> T2/T-T/B1-B3,5 (add intermediate T-T level)
R(z, 'T2/T-T/B1-B3,5')
kind, keys, kids = crack_btree(z)
assert (kind, keys) == (BTREE_NORMAL, [2])
assert len(kids) == 2
tl, tr = kids
kind, keys, kids = crack_btree(tl)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
assert kids[0] is b1
kind, keys, kids = crack_btree(tr)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
assert kids[0] is b35
assert crack_bucket(b1) == ([1], [X[1]])
assert crack_bucket(b35) == ([3,5], [X[3], X[5]])
tl, tr = assertT(z, [2], 'T','T')
assertT(tl, [], b1)
assertT(tr, [], b35)
assertB(b1, 1)
assertB(b35, 3,5)
# -> T2/T-T/B1-T/B3,5 (add intermediate T level in right arm)
R(z, 'T2/T-T/B1-T/B3,5')
assertT(z, [2], tl, tr)
"""
kind, keys, kids = crack_btree(z)
assert (kind, keys) == (BTREE_NORMAL, [2])
assert len(kids) == 2
assert kids[0] is tl
assert kids[1] is tr
"""
assertT(tl, [], b1)
"""
kind, keys, kids = crack_btree(tl) # XXX -> assertT ?
assert (kind, keys) == (BTREE_NORMAL, []) #
assert len(kids) == 1 #
assert kids[0] is b1 #
"""
trr, = assertT(tr, [], 'T')
"""
kind, keys, kids = crack_btree(tr)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
trr = kids[0]
"""
assert isinstance(trr, XLOTree)
assertT(trr, [], b35)
"""
kind, keys, kids = crack_btree(trr)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
assert kids[0] is b35
"""
assertB(b1, 1)
assertB(b35, 3,5)
"""
assert crack_bucket(b1) == ([1], [X[1]]) # XXX -> assertB ?
assert crack_bucket(b35) == ([3,5], [X[3], X[5]])
"""
......
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