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
404d4ec6
Commit
404d4ec6
authored
May 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6722f6b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
43 deletions
+5
-43
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+5
-43
No files found.
wcfs/internal/xbtree_test.py
View file @
404d4ec6
...
...
@@ -601,59 +601,21 @@ def test_restructure():
# -> T2/T-T/B1-B3,5 (add intermediate T-T level)
R
(
z
,
'T2/T-T/B1-B3,5'
)
kind
,
keys
,
kids
=
crack_btree
(
z
)
assert
(
kind
,
keys
)
==
(
BTREE_NORMAL
,
[
2
])
assert
len
(
kids
)
==
2
tl
,
tr
=
kids
kind
,
keys
,
kids
=
crack_btree
(
tl
)
assert
(
kind
,
keys
)
==
(
BTREE_NORMAL
,
[])
assert
len
(
kids
)
==
1
assert
kids
[
0
]
is
b1
kind
,
keys
,
kids
=
crack_btree
(
tr
)
assert
(
kind
,
keys
)
==
(
BTREE_NORMAL
,
[])
assert
len
(
kids
)
==
1
assert
kids
[
0
]
is
b35
assert
crack_bucket
(
b1
)
==
([
1
],
[
X
[
1
]])
assert
crack_bucket
(
b35
)
==
([
3
,
5
],
[
X
[
3
],
X
[
5
]])
tl
,
tr
=
assertT
(
z
,
[
2
],
'T'
,
'T'
)
assertT
(
tl
,
[],
b1
)
assertT
(
tr
,
[],
b35
)
assertB
(
b1
,
1
)
assertB
(
b35
,
3
,
5
)
# -> T2/T-T/B1-T/B3,5 (add intermediate T level in right arm)
R
(
z
,
'T2/T-T/B1-T/B3,5'
)
assertT
(
z
,
[
2
],
tl
,
tr
)
"""
kind, keys, kids = crack_btree(z)
assert (kind, keys) == (BTREE_NORMAL, [2])
assert len(kids) == 2
assert kids[0] is tl
assert kids[1] is tr
"""
assertT
(
tl
,
[],
b1
)
"""
kind, keys, kids = crack_btree(tl) # XXX -> assertT ?
assert (kind, keys) == (BTREE_NORMAL, []) #
assert len(kids) == 1 #
assert kids[0] is b1 #
"""
trr
,
=
assertT
(
tr
,
[],
'T'
)
"""
kind, keys, kids = crack_btree(tr)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
trr = kids[0]
"""
assert
isinstance
(
trr
,
XLOTree
)
assertT
(
trr
,
[],
b35
)
"""
kind, keys, kids = crack_btree(trr)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
assert kids[0] is b35
"""
assertB
(
b1
,
1
)
assertB
(
b35
,
3
,
5
)
"""
assert crack_bucket(b1) == ([1], [X[1]]) # XXX -> assertB ?
assert crack_bucket(b35) == ([3,5], [X[3], X[5]])
"""
...
...
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