Skip to content

Commit

Permalink
Add missing seed!(::_GLOBAL_RNG) method (#32961)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored and KristofferC committed Aug 20, 2019
1 parent 583fa6c commit 8ebe564
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions stdlib/Random/src/RNGs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ copy(::_GLOBAL_RNG) = copy(default_rng())
seed!(::_GLOBAL_RNG, seed::Vector{UInt32}) = seed!(default_rng(), seed)
seed!(::_GLOBAL_RNG, n::Integer) = seed!(default_rng(), n)
seed!(::_GLOBAL_RNG, ::Nothing) = seed!(default_rng(), nothing)
seed!(::_GLOBAL_RNG) = seed!(default_rng(), nothing)

rng_native_52(::_GLOBAL_RNG) = rng_native_52(default_rng())
rand(::_GLOBAL_RNG, sp::SamplerBoolBitInteger) = rand(default_rng(), sp)
Expand Down
1 change: 1 addition & 0 deletions stdlib/Random/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ end
@test Random.seed!(GLOBAL_RNG, nothing) === LOCAL_RNG
@test Random.seed!(GLOBAL_RNG, UInt32[0]) === LOCAL_RNG
@test Random.seed!(GLOBAL_RNG, 0) === LOCAL_RNG
@test Random.seed!(GLOBAL_RNG) === LOCAL_RNG

mt = MersenneTwister(1)
@test copy!(mt, GLOBAL_RNG) === mt
Expand Down

0 comments on commit 8ebe564

Please sign in to comment.