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
e65dd03f
Commit
e65dd03f
authored
Jul 08, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1dc9741a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+19
-13
No files found.
wcfs/internal/zdata/δftail_test.go
View file @
e65dd03f
...
@@ -156,20 +156,19 @@ func TestΔFtail(t_ *testing.T) {
...
@@ -156,20 +156,19 @@ func TestΔFtail(t_ *testing.T) {
}
}
}
}
if
len
(
δblk
)
==
0
{
t
.
Fatal
(
"BUG: prepared δblk = ø"
)
}
// commit updated blkTab + dataTab
// commit updated blkTab + dataTab
tdTxt
:=
fmt
.
Sprintf
(
"t%s D%s"
,
xbtreetest
.
KVTxt
(
blkTab
),
dataTabTxt
(
dataTab
))
tdTxt
:=
fmt
.
Sprintf
(
"t%s D%s"
,
xbtreetest
.
KVTxt
(
blkTab
),
dataTabTxt
(
dataTab
))
commit
:=
t
.
CommitTree
(
tdTxt
)
commit
:=
t
.
CommitTree
(
tdTxt
)
δfok
:=
&
ΔFile
{
var
δfok
*
ΔFile
Rev
:
commit
.
At
,
if
len
(
δblk
)
!=
0
{
Blocks
:
δblk
,
δfok
=
&
ΔFile
{
Size
:
true
/*XXX*/
,
Rev
:
commit
.
At
,
Blocks
:
δblk
,
Size
:
true
/*XXX*/
,
}
vδf
=
append
(
vδf
,
δfok
)
}
}
vδf
=
append
(
vδf
,
δfok
)
fmt
.
Printf
(
"@%s δT: %v δD: %s
\n
"
,
commit
.
At
,
test
.
δblkTab
,
test
.
δdataTab
)
fmt
.
Printf
(
"@%s δT: %v δD: %s
\n
"
,
commit
.
At
,
test
.
δblkTab
,
test
.
δdataTab
)
fmt
.
Printf
(
"@%s %s
\n
"
,
commit
.
At
,
commit
.
Tree
)
fmt
.
Printf
(
"@%s %s
\n
"
,
commit
.
At
,
commit
.
Tree
)
...
@@ -177,20 +176,27 @@ func TestΔFtail(t_ *testing.T) {
...
@@ -177,20 +176,27 @@ func TestΔFtail(t_ *testing.T) {
// update δftail
// update δftail
δF
,
err
:=
δftail
.
Update
(
commit
.
ΔZ
);
X
(
err
)
δF
,
err
:=
δftail
.
Update
(
commit
.
ΔZ
);
X
(
err
)
// assert δF points to the file
// assert δF points to the file
if δfok != ø
if
δF
.
Rev
!=
δfok
.
Rev
{
if
δF
.
Rev
!=
commit
.
At
{
t
.
Errorf
(
"wrong δF.Rev: have %s ; want %s"
,
δF
.
Rev
,
δfok
.
Rev
)
t
.
Errorf
(
"wrong δF.Rev: have %s ; want %s"
,
δF
.
Rev
,
commit
.
At
)
}
}
δfiles
:=
setOid
{}
δfiles
:=
setOid
{}
for
δfile
:=
range
δF
.
ByFile
{
for
δfile
:=
range
δF
.
ByFile
{
δfiles
.
Add
(
δfile
)
δfiles
.
Add
(
δfile
)
}
}
δfilesOK
:=
setOid
{};
δfilesOK
.
Add
(
zfile
.
POid
())
δfilesOK
:=
setOid
{}
if
δfok
!=
nil
{
δfilesOK
.
Add
(
zfile
.
POid
())
}
if
!
δfiles
.
Equal
(
δfilesOK
)
{
if
!
δfiles
.
Equal
(
δfilesOK
)
{
t
.
Errorf
(
"wrong δF.ByFile:
\n
have keys: %s
\n
want keys: %s"
,
δfiles
,
δfilesOK
)
t
.
Errorf
(
"wrong δF.ByFile:
\n
have keys: %s
\n
want keys: %s"
,
δfiles
,
δfilesOK
)
continue
continue
}
}
if
δfok
==
nil
{
continue
}
// verify δf
// verify δf
δf
:=
δF
.
ByFile
[
zfile
.
POid
()]
δf
:=
δF
.
ByFile
[
zfile
.
POid
()]
if
!
reflect
.
DeepEqual
(
δf
,
δfok
)
{
if
!
reflect
.
DeepEqual
(
δf
,
δfok
)
{
...
...
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