mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: use new array init syntax, fix mutability
This commit is contained in:
@@ -11,7 +11,7 @@ const (
|
||||
// NOTE: temp until we have []bytes(buff)
|
||||
fn c_array_to_bytes_tmp(len int, buffer voidptr) []byte {
|
||||
|
||||
mut arr := []byte
|
||||
mut arr := []byte{}
|
||||
arr = make(len, 1, 1)
|
||||
arr.data = buffer
|
||||
/*
|
||||
|
@@ -31,7 +31,7 @@ fn test_crypto_rand_read() {
|
||||
|
||||
fn test_crypto_rand_int_u64() {
|
||||
max := u64(160)
|
||||
mut unique := []int
|
||||
mut unique := []int{}
|
||||
for _ in 0..80 {
|
||||
r := rand.int_u64(max) or {
|
||||
assert false
|
||||
|
@@ -4,10 +4,8 @@
|
||||
|
||||
module rand
|
||||
|
||||
import(
|
||||
math.bits
|
||||
encoding.binary
|
||||
)
|
||||
import math.bits
|
||||
import encoding.binary
|
||||
|
||||
pub fn int_u64(max u64) ?u64 {
|
||||
bitlen := bits.len_64(max)
|
||||
|
Reference in New Issue
Block a user