Commit b4898066 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 822b420d
......@@ -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
}
......
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