Commit ff58a7c0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bbbc4713
...@@ -44,34 +44,17 @@ def test_structureOf(): ...@@ -44,34 +44,17 @@ def test_structureOf():
t, keys = testBTrees.DegenerateBTree("testBasicOps")._build_degenerate_tree() t, keys = testBTrees.DegenerateBTree("testBasicOps")._build_degenerate_tree()
assert keys == [1, 3, 5, 7, 11] assert keys == [1, 3, 5, 7, 11]
assert xbtree.StructureOf(t) == T([4], _ = xbtree.StructureOf(t)
T([2], assert _ == T([4],
T([], B(1)), T([], B(3))), T([2],
T([], T([], B(1)), T([], B(3))),
T([6, 10], T([],
T([], T([], B(5))), T([6, 10],
T([], B(7)), T([], T([], B(5))),
T([], B(11))) )) T([], B(7)),
T([], B(11))) ))
#assert xbtree.TopoEncode(t) == 'T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5'
assert xbtree.TopoEncode(_) == 'T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5'
"""
#assert btree.TopoEncodingOf(t) == ((4,), (2,), ø(4), (6,10), ø(5?), ø(7), ø(11), x(5?))
assert btree.TopoEncode(t) == \
(4,), (2,),(), (),(),(6,10), B(1),B(3),(),(),(), (),B(7),B(11), B(5)
# T4 T2-T T-T-T6,10 B1-B3-T-T-T T-B7-B11 B5 <-- good
# T4·T2-T·T-T-T6,10·B1-B3-T-T-T·T-B7-B11·B5. <- ?
# T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5 <- ? y
"""
"""
assert xbtree.TopologyOf(t) == ( (4,),
((2,), ()),
(((), ()), (6, 10)),
"""
def test_topoEncoding(): def test_topoEncoding():
......
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