Commit
Add more unit tests for test/random.jl in preparation for refactor
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,13 @@ | |
@test minimum([rand(int32(1):int32(7^7)) for i = 1:100000]) > 0 | ||
@test(typeof(rand(false:true)) == Bool) | ||
|
||
@test length(randn(4, 5)) == 20 | ||
@test length(randbool(4, 5)) == 20 | ||
|
||
# Test Reproducibility of Pseudo-Random Numbers | ||
rng = MersenneTwister(0) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
andreasnoack
Member
|
||
@test (rand(rng) - 0.07749284875576845) < 0.01 | ||
|
||
for T in (Int8, Uint8, Int16, Uint16, Int32, Uint32, Int64, Uint64, Int128, Uint128, Char, BigInt, | ||
Float16, Float32, Float64, Rational{Int}) | ||
r = rand(convert(T, 97):convert(T, 122)) | ||
|
1 comment
on commit 4dfbecc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiahao I expected this one to go through which fixes the randomness differences: #6018 (comment)
Need a platform independent seed value.