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
3ca2d3c8
Commit
3ca2d3c8
authored
Jun 02, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
78f260d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
16 deletions
+30
-16
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+30
-16
No files found.
wcfs/δbtail_test.go
View file @
3ca2d3c8
...
...
@@ -343,23 +343,10 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
}
}
//
Verify ΔBTail for explicitly provided tree topologies
.
func
TestΔBTail
(
t
*
testing
.
T
)
{
//
testΔBTail verifies ΔBTail on sequence of tree topologies coming from testq
.
func
testΔBTail
(
t
*
testing
.
T
,
testq
chan
string
)
{
X
:=
exc
.
Raiseif
// test known cases going through tree1 -> tree2 -> ...
testv
:=
[]
string
{
"T/B:"
,
"T/B1:a"
,
"T/B2:b"
,
// XXX
}
// direct tree_i -> tree_{i+1} -> _{i+2} ... plus
// reverse ... tree_i <- _{i+1} <- _{i+2}
for
i
:=
len
(
testv
)
-
2
;
i
>=
0
;
i
--
{
testv
=
append
(
testv
,
testv
[
i
])
}
work
,
err
:=
ioutil
.
TempDir
(
""
,
"δBTail"
);
X
(
err
)
defer
func
()
{
err
:=
os
.
RemoveAll
(
work
);
X
(
err
)
...
...
@@ -406,7 +393,7 @@ func TestΔBTail(t *testing.T) {
at1
:=
tg
.
head
kv1
:=
XGetTree
(
db
,
at1
,
tg
.
treeRoot
)
tree1
:=
"ø"
// initial
for
_
,
tree2
:=
range
testv
{
for
tree2
:=
range
testq
{
δZ
:=
XCommitTree
(
tree2
)
at2
:=
δZ
.
Tid
kv2
:=
XGetTree
(
db
,
at2
,
tg
.
treeRoot
)
...
...
@@ -420,8 +407,35 @@ func TestΔBTail(t *testing.T) {
}
}
// Verify ΔBTail for explicitly provided tree topologies.
func
TestΔBTail
(
t
*
testing
.
T
)
{
// test known cases going through tree1 -> tree2 -> ...
testv
:=
[]
string
{
"T/B:"
,
"T/B1:a"
,
"T/B2:b"
,
// XXX
}
// direct tree_i -> tree_{i+1} -> _{i+2} ... plus
// reverse ... tree_i <- _{i+1} <- _{i+2}
for
i
:=
len
(
testv
)
-
2
;
i
>=
0
;
i
--
{
testv
=
append
(
testv
,
testv
[
i
])
}
testq
:=
make
(
chan
string
)
go
func
()
{
defer
close
(
testq
)
for
_
,
tree
:=
range
testv
{
testq
<-
tree
}
}()
testΔBTail
(
t
,
testq
)
}
func
TestΔBTreeAllStructs
(
t
*
testing
.
T
)
{
// XXX given (kv1, kv2) test on automatically generated (tree1 -> tree2)
//testing.Short()
}
...
...
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