mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
tests: make error handling the same as the main function (#15825)
This commit is contained in:
parent
391ac12fe2
commit
41dbd12bc4
69 changed files with 193 additions and 192 deletions
|
@ -1,6 +1,6 @@
|
|||
import rand
|
||||
|
||||
fn test_rand_bytes() ? {
|
||||
fn test_rand_bytes() {
|
||||
mut randoms := []string{}
|
||||
for i in 0 .. 100 {
|
||||
x := rand.bytes(i)?.hex()
|
||||
|
@ -21,7 +21,7 @@ fn test_rand_bytes() ? {
|
|||
dump(differences)
|
||||
}
|
||||
|
||||
fn test_prng_rand_bytes() ? {
|
||||
fn test_prng_rand_bytes() {
|
||||
mut randoms := []string{}
|
||||
mut rng := rand.get_current_rng()
|
||||
for i in 0 .. 100 {
|
||||
|
@ -43,7 +43,7 @@ fn test_prng_rand_bytes() ? {
|
|||
dump(differences)
|
||||
}
|
||||
|
||||
fn test_rand_read() ? {
|
||||
fn test_rand_read() {
|
||||
max := 50
|
||||
mut a := []u8{len: max}
|
||||
mut differences := 0
|
||||
|
@ -72,7 +72,7 @@ fn test_rand_read() ? {
|
|||
assert differences > 11700 // normally around 11758
|
||||
}
|
||||
|
||||
fn test_prng_rand_read() ? {
|
||||
fn test_prng_rand_read() {
|
||||
max := 50
|
||||
mut a := []u8{len: max}
|
||||
mut differences := 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue