diff --git a/cmd/tools/vtest-fixed.v b/cmd/tools/vtest-fixed.v index 67b8ce0e5d..179c6a35fc 100644 --- a/cmd/tools/vtest-fixed.v +++ b/cmd/tools/vtest-fixed.v @@ -26,15 +26,12 @@ const ( 'vlib/math/complex/complex_test.v', 'vlib/math/factorial/factorial_test.v', 'vlib/math/fractions/fraction_test.v', - 'vlib/math/stats/stats_test.v', 'vlib/net/ftp/ftp_test.v', 'vlib/net/http/http_httpbin_test.v', 'vlib/net/http/http_test.v', 'vlib/net/socket_test.v', 'vlib/net/socket_udp_test.v', 'vlib/os/environment_test.v', // Linux only - 'vlib/rand/pcg32_test.v', - 'vlib/rand/splitmix64_test.v', 'vlib/regex/regex_test.v', 'vlib/sqlite/sqlite_test.v', // Linux only 'vlib/strconv/ftoa/f32_f64_to_string_test.v', diff --git a/vlib/rand/pcg32_test.v b/vlib/rand/pcg32_test.v index 2ac64e081d..546b7c7331 100644 --- a/vlib/rand/pcg32_test.v +++ b/vlib/rand/pcg32_test.v @@ -2,6 +2,15 @@ import rand import time +fn show_u32s(a []u32){ + mut res := []string + for x in a { + res << x.str() + } + print('[') + print(res.join(', ')) + println(']') +} fn gen_randoms(initstate i64, initseq i64, bound int) []u32 { mut randoms := [u32(0)].repeat(20) mut rnd := rand.new_pcg32( u64(initstate), u64(initseq) ) @@ -18,8 +27,8 @@ fn test_pcg32_reproducibility() { randoms1 := gen_randoms(t, tseq, 1000) randoms2 := gen_randoms(t, tseq, 1000) assert randoms1.len == randoms2.len - println( randoms1 ) - println( randoms2 ) + show_u32s(randoms1) + show_u32s(randoms2) len := randoms1.len for i in 0..len { assert randoms1[i] == randoms2[i] diff --git a/vlib/rand/splitmix64_test.v b/vlib/rand/splitmix64_test.v index dabae5bd9b..4f92b1eca4 100644 --- a/vlib/rand/splitmix64_test.v +++ b/vlib/rand/splitmix64_test.v @@ -2,6 +2,16 @@ import rand import time +fn show_u64s(a []u64){ + mut res := []string + for x in a { + res << x.str() + } + print('[') + print(res.join(', ')) + println(']') +} + fn gen_randoms(seed i64, bound int) []u64 { mut randoms := [u64(0)].repeat(20) mut rnd := rand.new_splitmix64( u64(seed) ) @@ -17,8 +27,8 @@ fn test_splitmix64_reproducibility() { randoms1 := gen_randoms(t, 1000) randoms2 := gen_randoms(t, 1000) assert randoms1.len == randoms2.len - println( randoms1 ) - println( randoms2 ) + show_u64s( randoms1 ) + show_u64s( randoms2 ) len := randoms1.len for i in 0..len { assert randoms1[i] == randoms2[i]