Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
4bcbfb16
Commit
4bcbfb16
authored
May 06, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
805a9653
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
17 deletions
+51
-17
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+4
-0
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+47
-17
No files found.
wcfs/internal/xbtree.py
View file @
4bcbfb16
...
...
@@ -68,6 +68,10 @@ class Tree:
__repr__
=
__str__
# TODO def dot() -> str for graphviz
# TODO def TopoEncode() -> str with topology encoding
# TODO @staticmethod def TopoDecode(in) <- Tree from topology string
# Bucked represents a bucket node.
class
Bucket
:
# .keyv () of keys
...
...
wcfs/internal/xbtree_test.py
View file @
4bcbfb16
...
...
@@ -86,20 +86,20 @@ def test_AllStructs():
#assert X([], 0, 1) == [ T([], B()), T([0], B(), B()) ]
assert
X
([],
1
,
0
)
==
X
([],
0
,
0
)
+
[
assert
X
([],
1
,
0
)
==
[
T
([],
B
()),
T
([],
T
([],
B
()))
]
T
([],
B
()))
]
assert
X
([],
2
,
0
)
==
X
([],
1
,
0
)
+
[
assert
X
([],
2
,
0
)
==
[
T
([],
B
()),
T
([],
T
([],
B
())),
T
([],
T
([],
T
([],
B
())))
]
T
([],
B
())))
]
assert
X
([
1
,
3
],
0
,
0
)
==
[
T
([],
B
(
1
,
3
))
]
assert
X
([
1
,
3
],
0
,
1
)
==
X
([
1
,
3
],
0
,
0
)
+
[
assert
X
([
1
,
3
],
0
,
1
)
==
[
T
([],
B
(
1
,
3
)),
# nsplit=1
T
([
0
],
B
(),
B
(
1
,
3
)),
T
([
1
],
B
(),
B
(
1
,
3
)),
...
...
@@ -108,15 +108,16 @@ def test_AllStructs():
T
([
4
],
B
(
1
,
3
),
B
()),
]
assert
X
([
1
,
3
],
1
,
0
)
==
X
([
1
,
3
],
0
,
0
)
+
[
assert
X
([
1
,
3
],
1
,
0
)
==
[
T
([],
B
(
1
,
3
)),
# depth=1
T
([],
T
([],
B
(
1
,
3
)))
]
return
assert
X
([
1
,
3
],
1
,
1
)
==
[
T
([],
B
(
1
,
3
)),
print
(
'
\
n
\
n
AAA
\
n
\
n
'
)
assert
X
([
1
,
3
],
1
,
1
)
==
[
# nsplit=0, depth=0
T
([],
B
(
1
,
3
)),
# nsplit=0,0, depth=1
T
([],
T
([],
B
(
1
,
3
))),
...
...
@@ -153,8 +154,8 @@ def test_AllStructs():
T
([
4
],
T
([],
B
(
1
,
3
)),
T
([],
B
())),
# nsplit=1,
1
depth=1
T
([
0
],
#
/0
# nsplit=1,
(0|1,0|1)
depth=1
T
([
0
],
#
T0/
T
([],
B
()),
T
([
1
],
B
(),
B
(
1
,
3
))),
T
([
0
],
...
...
@@ -166,7 +167,20 @@ def test_AllStructs():
T
([
0
],
T
([],
B
()),
T
([
4
],
B
(
1
,
3
),
B
())),
T
([
1
],
# /1
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
],
...
...
@@ -175,7 +189,20 @@ def test_AllStructs():
T
([
1
],
T
([
0
],
B
(),
B
()),
T
([
4
],
B
(
1
,
3
),
B
())),
T
([
2
],
# /2
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
],
...
...
@@ -187,7 +214,8 @@ def test_AllStructs():
T
([
2
],
T
([
1
],
B
(),
B
(
1
)),
T
([
4
],
B
(
3
),
B
())),
T
([
3
],
# /3
T
([
3
],
# T3/
T
([
0
],
B
(),
B
(
1
)),
T
([
4
],
B
(
3
),
B
())),
T
([
3
],
...
...
@@ -196,7 +224,8 @@ def test_AllStructs():
T
([
3
],
T
([
2
],
B
(
1
),
B
()),
T
([
4
],
B
(
3
),
B
())),
T
([
4
],
# /4
T
([
4
],
# T4/
T
([
0
],
B
(),
B
(
1
,
3
)),
T
([],
B
())),
T
([
4
],
...
...
@@ -212,6 +241,7 @@ def test_AllStructs():
# ... XXX continue
]
return
assert
X
([
1
,
3
],
0
,
2
)
==
[
T
([],
B
(
1
,
3
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment