Commit e52a3095 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 85e2ce23
......@@ -120,15 +120,17 @@ def test_allStructs():
return list(xbtree.AllStructs(keys, maxdepth, maxsplit, allowEmptyBuckets))
def Y(keys, maxdepth, maxsplit):
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 Y([], 0, 0) == [ T([], B()) ]
assert XY([], 0, 0) == [ T([], B()) ]
assert X([1], 0, 0) == [ T([], B(1)) ]
assert Y([1], 0, 0) == [ T([], B(1)) ]
assert XY([1], 0, 0) == [ T([], B(1)) ]
assert X([1,3], 0, 0) == [ T([], B(1,3)) ]
assert Y([1,3], 0, 0) == [ T([], B(1,3)) ]
assert XY([1,3], 0, 0) == [ T([], B(1,3)) ]
assert X([], 0, 1) == [ T([], B()) ] # nothing to split (?) -> y
#assert X([], 0, 1) == [ T([], B()), T([0], B(), B()) ]
......@@ -149,8 +151,7 @@ def test_allStructs():
assert Y([], 2, 0) == [ T([], B()) ]
assert X([1,3], 0, 0) == [ T([], B(1,3)) ]
assert Y([1,3], 0, 0) == [ T([], B(1,3)) ]
assert XY([1,3], 0, 0) == [ T([], B(1,3)) ]
assert X([1,3], 0, 1) == [ T([], B(1,3)),
# nsplit=1
......@@ -166,7 +167,7 @@ def test_allStructs():
T([3], B(1), B(3)),
]
assert X([1,3], 1, 0) == [ T([], B(1,3)),
assert XY([1,3], 1, 0) == [ T([], B(1,3)),
# depth=1
T([],
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