Commit e52a3095 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 85e2ce23
...@@ -120,57 +120,58 @@ def test_allStructs(): ...@@ -120,57 +120,58 @@ def test_allStructs():
return list(xbtree.AllStructs(keys, maxdepth, maxsplit, allowEmptyBuckets)) return list(xbtree.AllStructs(keys, maxdepth, maxsplit, allowEmptyBuckets))
def Y(keys, maxdepth, maxsplit): def Y(keys, maxdepth, maxsplit):
return X(keys, maxdepth, maxsplit, allowEmptyBuckets=False) return X(keys, maxdepth, maxsplit, allowEmptyBuckets=False)
def XY(keys, maxdepth, maxsplit):
x = X(keys, maxdepth, maxsplit)
y = Y(keys, maxdepth, maxsplit)
assert x == y
return x
assert X([], 0, 0) == [ T([], B()) ] assert XY([], 0, 0) == [ T([], B()) ]
assert Y([], 0, 0) == [ T([], B()) ]
assert X([1], 0, 0) == [ T([], B(1)) ] assert XY([1], 0, 0) == [ T([], B(1)) ]
assert Y([1], 0, 0) == [ T([], B(1)) ]
assert X([1,3], 0, 0) == [ T([], B(1,3)) ] assert XY([1,3], 0, 0) == [ T([], B(1,3)) ]
assert Y([1,3], 0, 0) == [ T([], B(1,3)) ]
assert X([], 0, 1) == [ T([], B()) ] # nothing to split (?) -> y assert X([], 0, 1) == [ T([], B()) ] # nothing to split (?) -> y
#assert X([], 0, 1) == [ T([], B()), T([0], B(), B()) ] #assert X([], 0, 1) == [ T([], B()), T([0], B(), B()) ]
assert Y([], 0, 1) == [ T([], B()) ] assert Y([], 0, 1) == [ T([], B()) ]
assert X([], 1, 0) == [ T([], B()), assert X([], 1, 0) == [ T([], B()),
T([], T([],
T([], B())) ] T([], B())) ]
assert Y([], 1, 0) == [ T([], B()) ] assert Y([], 1, 0) == [ T([], B()) ]
assert X([], 2, 0) == [ T([], B()), assert X([], 2, 0) == [ T([], B()),
T([],
T([], B())),
T([],
T([], T([],
T([], B()))) ] T([], B())),
assert Y([], 2, 0) == [ T([], B()) ] T([],
T([],
T([], B()))) ]
assert X([1,3], 0, 0) == [ T([], B(1,3)) ] assert Y([], 2, 0) == [ T([], B()) ]
assert Y([1,3], 0, 0) == [ T([], B(1,3)) ]
assert X([1,3], 0, 1) == [ T([], B(1,3)), assert XY([1,3], 0, 0) == [ T([], B(1,3)) ]
# nsplit=1
T([0], B(), B(1,3)), assert X([1,3], 0, 1) == [ T([], B(1,3)),
T([1], B(), B(1,3)), # nsplit=1
T([2], B(1), B(3)), T([0], B(), B(1,3)),
T([3], B(1), B(3)), T([1], B(), B(1,3)),
T([4], B(1,3), B()), T([2], B(1), B(3)),
] T([3], B(1), B(3)),
assert Y([1,3], 0, 1) == [ T([], B(1,3)), T([4], B(1,3), B()),
# nsplit=1 ]
T([2], B(1), B(3)), assert Y([1,3], 0, 1) == [ T([], B(1,3)),
T([3], B(1), B(3)), # nsplit=1
] T([2], B(1), B(3)),
T([3], B(1), B(3)),
assert X([1,3], 1, 0) == [ T([], B(1,3)), ]
# depth=1
T([], assert XY([1,3], 1, 0) == [ T([], B(1,3)),
T([], B(1,3))) # depth=1
] T([],
T([], B(1,3)))
]
assert X([1,3], 1, 1) == [ assert X([1,3], 1, 1) == [
# T/ # T/
......
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