v2 / vlib / v / tests / pointers / dereference_mut_interface_in_loop_test.v
16 lines · 14 sloc · 390 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1import rand
2import rand.wyrand
3import rand.splitmix64
4
5fn test_deref_mut_interface_in_loop() {
6 mut wyrand_rng := &rand.PRNG(&wyrand.WyRandRNG{})
7 mut splitmix_rng := &rand.PRNG(&splitmix64.SplitMix64RNG{})
8
9 mut generators := [wyrand_rng, splitmix_rng]
10 for mut rng in generators {
11 seed_len := rng.block_size() / 32
12 dump(seed_len)
13 println(rng.string(15))
14 assert seed_len == 2
15 }
16}
17