Commit cc0e6515 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 16eb6224
......@@ -486,28 +486,33 @@ func TestΔBTreeAllStructs(t *testing.T) {
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.
// generate cases: 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() }
testq := make(chan string)
go func() {
defer close(testq)
for i := range keysv1 {
keys1 := keysv1[i]
keys2 := keysv2[i]
// given (kv1, kv2) test on automatically generated (tree1 -> tree2)
fmt.Printf("%s -> %s\n", kvtxt(kv1), kvtxt(kv2))
kv1 := map[Key]string{}
kv2 := map[Key]string{}
for k := range keys1 { kv1[Key(k)] = randv() }
for k := range keys2 { kv2[Key(k)] = randv() }
}
// given (kv1, kv2) test on automatically generated (tree1 -> tree2)
fmt.Printf("%s -> %s\n", kvtxt(kv1), kvtxt(kv2))
_ = maxdepth; _ = maxsplit; _ = n; _ = rng
}
}()
testΔBTail(t, testq)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment