mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
rand: reorganize: phase 2
This commit is contained in:
@@ -8,5 +8,5 @@ const (
|
||||
)
|
||||
// random returns a random time struct in *the past*.
|
||||
pub fn random() time.Time {
|
||||
return time.unix(rand.next(int(start_time_unix)))
|
||||
return time.unix(int(rand.u64n(start_time_unix)))
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import rand
|
||||
|
||||
fn test_random() {
|
||||
// guarantee CI test stability, by seeding the random number generator with a known seed
|
||||
rand.seed(0)
|
||||
rand.seed([u32(0), 0])
|
||||
t1 := tmisc.random()
|
||||
t2 := tmisc.random()
|
||||
t3 := tmisc.random()
|
||||
|
||||
Reference in New Issue
Block a user