| 1 | import time.misc as tmisc |
| 2 | import rand |
| 3 | |
| 4 | fn test_random() { |
| 5 | // guarantee CI test stability, by seeding the random number generator with a known seed |
| 6 | rand.seed([u32(0), 0]) |
| 7 | t1 := tmisc.random() |
| 8 | t2 := tmisc.random() |
| 9 | t3 := tmisc.random() |
| 10 | t4 := tmisc.random() |
| 11 | assert t1.unix() != t2.unix() |
| 12 | assert t1.unix() != t3.unix() |
| 13 | assert t1.unix() != t4.unix() |
| 14 | assert t2.unix() != t3.unix() |
| 15 | assert t2.unix() != t4.unix() |
| 16 | assert t3.unix() != t4.unix() |
| 17 | } |
| 18 |