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
9f07b5a3
Commit
9f07b5a3
authored
Jun 01, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5bc146bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+6
-5
No files found.
wcfs/δbtail_test.go
View file @
9f07b5a3
...
...
@@ -200,6 +200,9 @@ func XGetTree(db *zodb.DB, at zodb.Tid, root zodb.Oid) map[Key]string {
// it is known that @at1 and @at2 the tree has kv1 and kv2 values correspondingly.
// it is known that for at1->at2 ZODB-level change is δZ.
func
xverifyΔBTail
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
kv1
,
kv2
map
[
Key
]
string
,
δZ
*
zodb
.
EventCommit
)
{
d12
:=
kvdiff
(
kv1
,
kv2
)
fmt
.
Println
(
"d12:"
,
d12
)
// verify transition at1->at2 for all initial states of tracked {keys} from kv1
keyv1
:=
[]
Key
{}
for
k1
:=
range
kv1
{
...
...
@@ -215,13 +218,13 @@ func xverifyΔBTail(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, at1, at2 zodb.
keys
[
i
]
=
keyv1
[
i
]
}
xverifyΔBTail1
(
t
,
db
,
treeRoot
,
at1
,
at2
,
kv1
,
kv2
,
δZ
,
keys
)
xverifyΔBTail1
(
t
,
db
,
treeRoot
,
at1
,
at2
,
kv1
,
kv2
,
d12
,
δZ
,
keys
)
}
}
// xverifyΔBTail1 verifies how ΔBTail handles ZODB update at1->at2 from initial
// tracked state defined by initialTrackedKeys.
func
xverifyΔBTail1
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
kv1
,
kv2
map
[
Key
]
string
,
δZ
*
zodb
.
EventCommit
,
initialTrackedKeys
[]
Key
)
{
func
xverifyΔBTail1
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
kv1
,
kv2
,
d12
map
[
Key
]
string
,
δZ
*
zodb
.
EventCommit
,
initialTrackedKeys
[]
Key
)
{
X
:=
exc
.
Raiseif
assert
:=
require
.
New
(
t
)
fmt
.
Println
(
"verify1"
,
initialTrackedKeys
)
...
...
@@ -249,8 +252,6 @@ func xverifyΔBTail1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, at1,at2 zodb.
δB
:=
δbtail
.
Update
(
δZ
)
assert
.
Equal
(
δB
.
Rev
,
δZ
.
Tid
)
d12
:=
kvdiff
(
kv1
,
kv2
)
fmt
.
Println
(
"d12:"
,
d12
)
//if len(d12) == 0 && len(initialTrackedKeys) == 0 {
if
len
(
initialTrackedKeys
)
==
0
{
assert
.
Equal
(
len
(
δB
.
ByRoot
),
0
)
...
...
@@ -370,7 +371,7 @@ func TestΔBTail(t *testing.T) {
at2
:=
δZ
.
Tid
kv2
:=
XGetTree
(
db
,
at2
,
tg
.
treeRoot
)
fmt
.
Printf
(
"%s -> %s
\n
"
,
tree1
,
tree2
)
// XXX -> subtest? excctx?
fmt
.
Printf
(
"
\n
%s -> %s
\n
"
,
tree1
,
tree2
)
// XXX -> subtest? excctx?
xverifyΔBTail
(
t
,
db
,
tg
.
treeRoot
,
at1
,
at2
,
kv1
,
kv2
,
δZ
)
at1
=
at2
...
...
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