Commit db628bed authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f954213c
......@@ -180,7 +180,7 @@ def _allStructs(klo, khi, keyv, maxdepth, maxsplit):
for nsplit in range(0, maxsplit+1):
for ksplitv in _iterSplitByN(klo, khi, nsplit):
# ksplitv = [klo, s1, s2, ..., sN, khi]
print('ksplitv: %r' % ksplitv)
#print('ksplitv: %r' % ksplitv)
# emit Tree -> Buckets
children = []
......
......@@ -115,15 +115,159 @@ def test_AllStructs():
]
print('\n\nAAA\n\n')
q = X([1,3], 1, 1)
print()
r = q[0]
print(r)
z = T([], B(1,3))
print(z)
print(r == z)
print()
1/0
assert X([1,3], 1, 1) == [
# nsplit=0, depth=0
T([], B(1,3)),
# nsplit=0,0, depth=1
T([],
T([], B(1,3))),
# nsplit=0,1, depth=1
T([],
T([0], B(), B(1,3))),
T([],
T([1], B(), B(1,3))),
T([],
T([2], B(1), B(3))),
T([],
T([3], B(1), B(3))),
T([],
T([4], B(1,3), B())),
# nsplit=1, depth=0
T([0], B(), B(1,3)),
T([0], # nsplit=1,(0,0)
T([], B()),
T([], B(1,3))),
# nsplit=1,(0,1)
T([0], # T0/
T([], B()),
T([1], B(), B(1,3))),
T([0],
T([], B()),
T([2], B(1), B(3))),
T([1], B(), B(1,3)),
T([2], B(1), B(3)),
T([3], B(1), B(3)),
T([4], B(1,3), B()),
# nsplit=1,0 depth=1
#T([0],
# T([], B()),
# T([], B(1,3))),
T([1],
T([], B()),
T([], B(1,3))),
T([2],
T([], B(1)),
T([], B(3))),
T([3],
T([], B(1)),
T([], B(3))),
T([4],
T([], B(1,3)),
T([], B())),
# nsplit=1,(0|1,0|1) depth=1
#T([0], # T0/
# T([], B()),
# T([1], B(), B(1,3))),
#T([0],
# T([], B()),
# T([2], B(1), B(3))),
T([0],
T([], B()),
T([3], B(1), B(3))),
T([0],
T([], B()),
T([4], B(1,3), B())),
T([1], # T1/
T([], B()), # nsplit=1,(0,1)
T([2], B(1), B(3))),
T([1],
T([], B()),
T([3], B(1), B(3))),
T([1],
T([], B()),
T([4], B(1,3), B())),
T([1], # nsplit=1,(1,0)
T([0], B(), B()),
T([], B(1,3))),
T([1], # nsplit=1,(1,1)
T([0], B(), B()),
T([2], B(1), B(3))),
T([1],
T([0], B(), B()),
T([3], B(1), B(3))),
T([1],
T([0], B(), B()),
T([4], B(1,3), B())),
T([2], # T2/
T([], B(1)), # nsplit=1,(0,1)
T([3], B(), B(3))),
T([2],
T([], B(1)),
T([4], B(3), B())),
T([2], # nsplit=1,(1,0)
T([0], B(), B(1)),
T([], B(3))),
T([2],
T([1], B(), B(1)),
T([], B(3))),
T([2], # nsplit=1,(1,1)
T([0], B(), B(1)),
T([3], B(), B(3))),
T([2],
T([0], B(), B(1)),
T([4], B(3), B())),
T([2],
T([1], B(), B(1)),
T([3], B(), B(3))),
T([2],
T([1], B(), B(1)),
T([4], B(3), B())),
T([3], # T3/
T([], B(1)), # nsplit=1,(0,1)
T([4], B(3), B())),
T([3], # nsplit=1,(1,0)
T([0], B(), B(1)),
T([], B(3))),
T([3],
T([1], B(), B(1)),
T([], B(3))),
T([3],
T([2], B(1), B()),
T([], B(3))),
T([3], # nsplit=1,(1,1)
T([0], B(), B(1)),
T([4], B(3), B())),
T([3],
T([1], B(), B(1)),
T([4], B(3), B())),
T([3],
T([2], B(1), B()),
T([4], B(3), B())),
T([4], # T4/
T([0], B(), B(1,3)),
T([], B())),
T([4],
T([1], B(), B(1,3)),
T([], B())),
T([4],
T([2], B(1), B(3)),
T([], B())),
T([4],
T([3], B(1), B(3)),
T([], B())),
]
return
print('\n\nBBB\n\n')
assert X([1,3], 1, 1) == [
# nsplit=0, depth=0
T([], B(1,3)),
......
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