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
476da755
Commit
476da755
authored
Apr 22, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a090c92b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+16
-15
No files found.
wcfs/δbtail_test.go
View file @
476da755
...
@@ -773,13 +773,21 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
...
@@ -773,13 +773,21 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
// xverifyΔBtail_Get verifies δBtail.Get on series of vt ZODB changes.
// xverifyΔBtail_Get verifies δBtail.Get on series of vt ZODB changes.
// XXX
// XXX
func
xverifyΔBTail_Get
(
t
*
testing
.
T
,
subj
string
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
vt
...*
tTreeCommit
)
{
func
xverifyΔBTail_Get
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
vt
...*
tTreeCommit
)
{
subj
=
vt
[
0
]
.
tree
subj
:
=
vt
[
0
]
.
tree
for
_
,
t
:=
range
vt
[
1
:
]
{
for
_
,
t
:=
range
vt
[
1
:
]
{
subj
+=
"→"
+
t
.
tree
subj
+=
"→"
+
t
.
tree
}
}
t
.
Run
(
fmt
.
Sprintf
(
"Get/%s"
,
subj
),
func
(
t
*
testing
.
T
)
{
t
.
Run
(
fmt
.
Sprintf
(
"Get/%s"
,
subj
),
func
(
t
*
testing
.
T
)
{
// tid -> "at_i"
xat
:=
map
[
zodb
.
Tid
]
string
{}
for
i
:=
range
vt
{
xat
[
vt
[
i
]
.
at
]
=
fmt
.
Sprintf
(
"at%d"
,
i
)
fmt
.
Printf
(
"@%s: %v
\n
"
,
xat
[
vt
[
i
]
.
at
],
xkvFlatten
(
vt
[
i
]
.
xkv
))
}
tkeys
:=
allTestKeys
(
vt
...
)
tkeys
:=
allTestKeys
(
vt
...
)
tkeyv
:=
tkeys
.
SortedKeys
()
tkeyv
:=
tkeys
.
SortedKeys
()
...
@@ -792,21 +800,14 @@ func xverifyΔBTail_Get(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oi
...
@@ -792,21 +800,14 @@ func xverifyΔBTail_Get(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oi
}
}
t
.
Run
(
fmt
.
Sprintf
(
"track=%s"
,
keys
),
func
(
t
*
testing
.
T
)
{
t
.
Run
(
fmt
.
Sprintf
(
"track=%s"
,
keys
),
func
(
t
*
testing
.
T
)
{
xverifyΔBTail_Get1
(
t
,
db
,
treeRoot
,
vt
,
keys
)
xverifyΔBTail_Get1
(
t
,
db
,
treeRoot
,
vt
,
xat
,
keys
)
})
})
}
}
})
})
}
}
func
xverifyΔBTail_Get1
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
vt
[]
*
tTreeCommit
,
keys
SetKey
)
{
func
xverifyΔBTail_Get1
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
vt
[]
*
tTreeCommit
,
xat
map
[
zodb
.
Tid
]
string
,
keys
SetKey
)
{
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
// XXX tracked / ?
// tid -> "at_i"
xat
:=
map
[
zodb
.
Tid
]
string
{}
for
i
:=
range
vt
{
xat
[
vt
[
i
]
.
at
]
=
fmt
.
Sprintf
(
"at%d"
,
i
)
}
// t1->t2-> ... -> tn
// t1->t2-> ... -> tn
δbtail
:=
NewΔBtail
(
vt
[
0
]
.
at
,
db
)
δbtail
:=
NewΔBtail
(
vt
[
0
]
.
at
,
db
)
...
@@ -854,7 +855,7 @@ func xverifyΔBTail_Get1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, vt []*tTr
...
@@ -854,7 +855,7 @@ func xverifyΔBTail_Get1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, vt []*tTr
if
!
(
v
==
v_
&&
ok
==
ok_
&&
rev
==
rev_
&&
revExact
==
revExact_
)
{
if
!
(
v
==
v_
&&
ok
==
ok_
&&
rev
==
rev_
&&
revExact
==
revExact_
)
{
t
.
Errorf
(
"Get(%d, @%s) ->
\n
have: %s, %v, @%s, %v
\n
want: %s, %v, @%s, %v"
,
t
.
Errorf
(
"Get(%d, @%s) ->
\n
have: %s, %v, @%s, %v
\n
want: %s, %v, @%s, %v"
,
k
,
at
,
k
,
xat
[
at
]
,
v
,
ok
,
xat
[
rev
],
revExact
,
v
,
ok
,
xat
[
rev
],
revExact
,
v_
,
ok_
,
xat
[
rev_
],
revExact_
)
v_
,
ok_
,
xat
[
rev_
],
revExact_
)
}
}
...
@@ -966,10 +967,10 @@ func testΔBTail(t *testing.T, testq chan ΔBTestEntry) {
...
@@ -966,10 +967,10 @@ func testΔBTail(t *testing.T, testq chan ΔBTestEntry) {
xverifyΔBTail_Update
(
t
,
subj
,
db
,
tg
.
treeRoot
,
t1
,
t2
,
test
.
kadjOK
)
xverifyΔBTail_Update
(
t
,
subj
,
db
,
tg
.
treeRoot
,
t1
,
t2
,
test
.
kadjOK
)
// ΔBTail.Get
// ΔBTail.Get
xverifyΔBTail_Get
(
t
,
"XXX"
,
db
,
tg
.
treeRoot
,
t2
)
xverifyΔBTail_Get
(
t
,
db
,
tg
.
treeRoot
,
t2
)
xverifyΔBTail_Get
(
t
,
"XXX"
,
db
,
tg
.
treeRoot
,
t1
,
t2
)
xverifyΔBTail_Get
(
t
,
db
,
tg
.
treeRoot
,
t1
,
t2
)
if
t0
!=
nil
{
if
t0
!=
nil
{
xverifyΔBTail_Get
(
t
,
"XXX"
,
db
,
tg
.
treeRoot
,
t0
,
t1
,
t2
)
xverifyΔBTail_Get
(
t
,
db
,
tg
.
treeRoot
,
t0
,
t1
,
t2
)
}
}
// XXX ΔBTail.SliceByRootRev
// XXX ΔBTail.SliceByRootRev
...
...
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