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
f8102804
Commit
f8102804
authored
Jun 17, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d962ce87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+19
-5
No files found.
wcfs/δbtail_test.go
View file @
f8102804
...
...
@@ -601,7 +601,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
// - outside tracked set -> may be present in δT (kadj gives exact answer)
// δT is subset of d12
for
k
:=
range
δT
{
for
_
,
k
:=
range
SortedKeys
(
δT
)
{
_
,
ind12
:=
d12
[
k
]
if
ind12
{
badf
(
"δT: [%v] is not in d12"
,
k
)
...
...
@@ -610,7 +610,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
// k ∈ tracked set -> must be present in δT
// k ∉ tracked set -> may be present in δT (kadj gives exact answer)
for
k
:=
range
d12
{
for
_
,
k
:=
range
SortedKeys
(
d12
)
{
_
,
inδT
:=
δT
[
k
]
if
inδT
&&
!
inδTOK
.
Has
(
k
)
{
badf
(
"δT: [%v] is extra"
,
k
)
...
...
@@ -1073,15 +1073,29 @@ func xkvFlatten(xkv RBucketSet) map[Key]string {
}
// easies debugging.
func
(
ks
SetKey
)
S
tring
()
string
{
// easies debugging
/ makes error output stable from run to run
.
func
(
ks
SetKey
)
S
ortedKeys
()
[]
Key
{
keyv
:=
ks
.
Elements
()
sort
.
Slice
(
keyv
,
func
(
i
,
j
int
)
bool
{
return
keyv
[
i
]
<
keyv
[
j
]
})
return
keyv
}
func
(
ks
SetKey
)
String
()
string
{
strv
:=
[]
string
{}
for
_
,
k
:=
range
k
eyv
{
for
_
,
k
:=
range
k
s
.
SortedKeys
()
{
strv
=
append
(
strv
,
fmt
.
Sprintf
(
"%d"
,
k
))
}
return
"{"
+
strings
.
Join
(
strv
,
" "
)
+
"}"
}
func
SortedKeys
(
kv
map
[
Key
]
string
)
[]
Key
{
keyv
:=
[]
Key
{}
for
k
:=
range
kv
{
keyv
=
append
(
keyv
,
k
)
}
sort
.
Slice
(
keyv
,
func
(
i
,
j
int
)
bool
{
return
keyv
[
i
]
<
keyv
[
j
]
})
return
keyv
}
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