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
fdb285e2
Commit
fdb285e2
authored
Jul 11, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9b62c5ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+12
-9
No files found.
wcfs/internal/zdata/δftail_test.go
View file @
fdb285e2
...
@@ -214,7 +214,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -214,7 +214,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
xat
:=
map
[
zodb
.
Tid
]
string
{}
// tid > "at<i>"
xat
:=
map
[
zodb
.
Tid
]
string
{}
// tid > "at<i>"
// δfstr
converts
δf to string taking xat into account
// δfstr
/vδfstr converts δf/v
δf to string taking xat into account
δfstr
:=
func
(
δf
*
ΔFile
)
string
{
δfstr
:=
func
(
δf
*
ΔFile
)
string
{
s
:=
fmt
.
Sprintf
(
"@%s·%s"
,
xat
[
δf
.
Rev
],
δf
.
Blocks
)
s
:=
fmt
.
Sprintf
(
"@%s·%s"
,
xat
[
δf
.
Rev
],
δf
.
Blocks
)
if
δf
.
Size
{
if
δf
.
Size
{
...
@@ -222,6 +222,14 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -222,6 +222,14 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
}
}
return
s
return
s
}
}
vδfstr
:=
func
(
vδf
[]
*
ΔFile
)
string
{
var
s
[]
string
for
_
,
δf
:=
range
vδf
{
s
=
append
(
s
,
δfstr
(
δf
))
}
return
fmt
.
Sprintf
(
"%s"
,
s
)
}
i
:=
0
i
:=
0
for
test
:=
range
testq
{
for
test
:=
range
testq
{
...
@@ -303,6 +311,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -303,6 +311,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
xat
[
commit
.
At
]
=
fmt
.
Sprintf
(
"at%d"
,
i
)
xat
[
commit
.
At
]
=
fmt
.
Sprintf
(
"at%d"
,
i
)
t
.
Logf
(
"# → @%s (%s) δT%s δD%s
\t
; %s
\t
δ%s"
,
xat
[
commit
.
At
],
commit
.
At
,
xbtreetest
.
KVTxt
(
test
.
δblkTab
),
test
.
δdataTab
,
tTxt
,
δblk
)
t
.
Logf
(
"# → @%s (%s) δT%s δD%s
\t
; %s
\t
δ%s"
,
xat
[
commit
.
At
],
commit
.
At
,
xbtreetest
.
KVTxt
(
test
.
δblkTab
),
test
.
δdataTab
,
tTxt
,
δblk
)
//t.Logf("# vδf: %s", vδfstr(vδf))
//fmt.Printf("Zinblk: %v\n", Zinblk)
//fmt.Printf("Zinblk: %v\n", Zinblk)
...
@@ -361,6 +370,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -361,6 +370,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
t
.
Logf
(
"# forget ≤ @%s"
,
xat
[
revcut
])
t
.
Logf
(
"# forget ≤ @%s"
,
xat
[
revcut
])
δftail
.
ForgetPast
(
revcut
)
δftail
.
ForgetPast
(
revcut
)
vδf
=
vδf
[
1
:
]
vδf
=
vδf
[
1
:
]
//t.Logf("# vδf: %s", vδfstr(vδf))
}
}
// SliceByFileRev
// SliceByFileRev
...
@@ -377,14 +387,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -377,14 +387,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδf_ok
:=
vδf
[
j
:
k
+
1
]
// [j,k]
vδf_ok
:=
vδf
[
j
:
k
+
1
]
// [j,k]
vδf_
:=
δftail
.
SliceByFileRev
(
zfile
,
lo
,
hi
)
vδf_
:=
δftail
.
SliceByFileRev
(
zfile
,
lo
,
hi
)
if
!
reflect
.
DeepEqual
(
vδf_
,
vδf_ok
)
{
if
!
reflect
.
DeepEqual
(
vδf_
,
vδf_ok
)
{
var
sδf_
,
sδf_ok
[]
string
t
.
Errorf
(
"slice (@%s,@%s]:
\n
have: %v
\n
want: %v"
,
xat
[
lo
],
xat
[
hi
],
vδfstr
(
vδf_
),
vδfstr
(
vδf_ok
))
for
_
,
δf
:=
range
vδf_
{
sδf_
=
append
(
sδf_
,
δfstr
(
δf
))
}
for
_
,
δf
:=
range
vδf_ok
{
sδf_ok
=
append
(
sδf_ok
,
δfstr
(
δf
))
}
t
.
Errorf
(
"slice (@%s,@%s]:
\n
have: %v
\n
want: %v"
,
xat
[
lo
],
xat
[
hi
],
sδf_
,
sδf_ok
)
}
}
}
}
}
}
...
...
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