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
b4898066
Commit
b4898066
authored
Jun 02, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
822b420d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
6 deletions
+29
-6
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+29
-6
No files found.
wcfs/δbtail_test.go
View file @
b4898066
...
...
@@ -456,6 +456,7 @@ func TestΔBTreeAllStructs(t *testing.T) {
// XXX explain that py program startup is very slow due to
// pkg_resources (+ link) -> we use server + request/response.
// random seed
seed
:=
time
.
Now
()
.
UnixNano
()
seeds
:=
os
.
Getenv
(
"DBTail_SEED"
)
if
seeds
!=
""
{
...
...
@@ -465,22 +466,44 @@ func TestΔBTreeAllStructs(t *testing.T) {
t
.
Fatalf
(
"invalid $DBTail_SEED=%s: %s"
,
seeds
,
err
)
}
}
t
.
Logf
(
"# seed=%d"
,
seed
)
rng
:=
rand
.
New
(
rand
.
NewSource
(
seed
))
maxdepth
:=
2
// XXX -> 3?
maxsplit
:=
1
// XXX -> 2?
n
:=
10
// XXX -> more?
/*
kv1 = {}
// keysv1 and keysv2 are random shuffle of IntSets
var
keysv1
[][]
int
var
keysv2
[][]
int
for
keys
:=
range
IntSets
(
5
)
{
// XXX !short -> ↑
kv2 = {k -> v=random.choice('abcdefgh'); for k in keys }
keysv1
=
append
(
keysv1
,
keys
)
keysv2
=
append
(
keysv2
,
keys
)
}
v
:=
keysv1
rng
.
Shuffle
(
len
(
v
),
func
(
i
,
j
int
)
{
v
[
i
],
v
[
j
]
=
v
[
j
],
v
[
i
]
})
v
=
keysv2
rng
.
Shuffle
(
len
(
v
),
func
(
i
,
j
int
)
{
v
[
i
],
v
[
j
]
=
v
[
j
],
v
[
i
]
})
// generate case: keysv1[i] -> keysv2[i] with values generated randomly
// along the way.
vv
:=
"abcdefgh"
randv
:=
func
()
string
{
i
:=
rng
.
Intn
(
len
(
vv
))
return
vv
[
i
:
i
+
1
]
}
for
i
:=
range
keysv1
{
keys1
:=
keysv1
[
i
]
keys2
:=
keysv2
[
i
]
kv1
:=
map
[
Key
]
string
{}
kv2
:=
map
[
Key
]
string
{}
for
k
:=
range
keys1
{
kv1
[
Key
(
k
)]
=
randv
()
}
for
k
:=
range
keys2
{
kv2
[
Key
(
k
)]
=
randv
()
}
//kvtxt(kv1), kvtxt(kv2)
}
*/
_
=
maxdepth
;
_
=
maxsplit
;
_
=
n
;
_
=
rng
}
...
...
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