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
964898fa
Commit
964898fa
authored
Jul 08, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e65dd03f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
24 deletions
+41
-24
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+41
-24
No files found.
wcfs/internal/zdata/δftail_test.go
View file @
964898fa
...
...
@@ -43,36 +43,18 @@ import (
type
setStr
=
set
.
Str
const
ø
=
"ø"
// ΔFTestEntry represents one entry in ΔFtail tests.
type
ΔFTestEntry
struct
{
δblkTab
map
[
int64
]
string
// changes in tree part {} #blk -> ZBlk<oid>
δdataTab
setStr
// changes to ZBlk objects
}
func
TestΔFtail
(
t_
*
testing
.
T
)
{
func
testΔFtail
(
t_
*
testing
.
T
,
testq
chan
ΔFTestEntry
)
{
t
:=
xbtreetest
.
NewT
(
t_
)
X
:=
exc
.
Raiseif
// δT is shorthand to create δblkTab.
type
δT
=
map
[
int64
]
string
// δD is shorthand to create δdataTab.
δD
:=
func
(
zblkv
...
string
)
setStr
{
δ
:=
setStr
{}
for
_
,
zblk
:=
range
zblkv
{
δ
.
Add
(
zblk
)
}
return
δ
}
const
a
,
b
,
c
,
ø
=
"a"
,
"b"
,
"c"
,
"ø"
testv
:=
[]
ΔFTestEntry
{
{
δT
{
1
:
a
,
2
:
b
,
3
:
ø
},
δD
(
a
)},
{
δT
{},
δD
(
c
)},
{
δT
{
2
:
c
},
δD
(
a
,
b
)},
}
δftail
:=
NewΔFtail
(
t
.
Head
()
.
At
,
t
.
DB
)
// load zfile via root['treegen/file']
...
...
@@ -111,7 +93,9 @@ func TestΔFtail(t_ *testing.T) {
}
for
i
,
test
:=
range
testv
{
i
:=
0
for
test
:=
range
testq
{
i
++
fmt
.
Printf
(
"
\n
δT: %v δD: %s
\n
"
,
test
.
δblkTab
,
test
.
δdataTab
)
δblk
:=
setI64
{}
...
...
@@ -207,8 +191,41 @@ func TestΔFtail(t_ *testing.T) {
}
}
// XXX TestΔFtailRandom(t *testing.T) {
//}
func
TestΔFtail
(
t
*
testing
.
T
)
{
// δT is shorthand to create δblkTab.
type
δT
=
map
[
int64
]
string
// δD is shorthand to create δdataTab.
δD
:=
func
(
zblkv
...
string
)
setStr
{
δ
:=
setStr
{}
for
_
,
zblk
:=
range
zblkv
{
δ
.
Add
(
zblk
)
}
return
δ
}
const
a
,
b
,
c
=
"a"
,
"b"
,
"c"
testv
:=
[]
ΔFTestEntry
{
{
δT
{
1
:
a
,
2
:
b
,
3
:
ø
},
δD
(
a
)},
{
δT
{},
δD
(
c
)},
{
δT
{
2
:
c
},
δD
(
a
,
b
)},
// XXX more
}
testq
:=
make
(
chan
ΔFTestEntry
)
go
func
()
{
defer
close
(
testq
)
for
_
,
test
:=
range
testv
{
testq
<-
test
}
}()
testΔFtail
(
t
,
testq
)
}
func
TestΔFtailRandom
(
t
*
testing
.
T
)
{
// XXX
}
// dataTabTxt returns string representation of {} dataTab.
...
...
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