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
b9a470e7
Commit
b9a470e7
authored
May 11, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ea457e4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+12
-5
No files found.
wcfs/internal/xbtree_test.py
View file @
b9a470e7
...
...
@@ -289,6 +289,13 @@ class XLOTree(LOBTree):
max_internal_size
=
2
def
crack_btree
(
ztree
):
return
bcheck
.
crack_btree
(
ztree
,
is_mapping
=
True
)
def
crack_bucket
(
zbucket
):
return
bcheck
.
crack_bucket
(
zbucket
,
is_mapping
=
True
)
def
test_restructure
():
#T = xbtree.Tree
#B = xbtree.Bucket
...
...
@@ -323,22 +330,22 @@ def test_restructure():
# Z0 creates new empty tree
def
Z0
():
z
=
Z
()
assert
bcheck
.
crack_btree
(
)
==
(
BTREE_EMPTY
,
[],
[])
assert
crack_btree
(
z
)
==
(
BTREE_EMPTY
,
[],
[])
return
z
# ø -> T/B
z
=
Z0
()
R
(
z
,
'T/B'
)
assert
bcheck
.
crack_btree
(
z
)
==
(
BTREE_NORMAL
,
[],
LOBucket
())
# XXX -> BTREE_ONE
assert
crack_btree
(
z
)
==
(
BTREE_NORMAL
,
[],
LOBucket
())
# XXX -> BTREE_ONE
# ø -> T/T/B
z
=
Z0
()
R
(
z
,
'T/T/B'
)
kind
,
keys
,
kids
=
bcheck
.
crack_btree
(
z
)
kind
,
keys
,
kids
=
crack_btree
(
z
)
assert
kind
,
keys
==
(
BTREE_NORMAL
,
[])
assert
len
(
kids
)
==
0
assert
isinstance
(
kids
[
0
],
XLOTree
)
kind
,
keys
,
kids
=
bcheck
.
crack_btree
(
kids
[
0
])
kind
,
keys
,
kids
=
crack_btree
(
kids
[
0
])
assert
kind
,
keys
==
(
BTREE_NORMAL
,
[])
# XXX or should it be BTREE_ONE here?
# XXX no: we need to wire bucket->next properly
assert
len
(
kids
)
==
0
...
...
@@ -352,7 +359,7 @@ def test_restructure():
# tree with one not-yet committed bucket
z
=
Z
(
1
,
3
)
assert
bcheck
.
crack_btree
(
)
==
(
BTREE_ONE
,
(
1
,
X
[
1
],
3
,
X
[
3
]),
None
)
assert
crack_btree
(
z
)
==
(
BTREE_ONE
,
(
1
,
X
[
1
],
3
,
X
[
3
]),
None
)
# XXX tree with one committed bucket
...
...
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