mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 22:45:03 +02:00
* random.c (rb_reset_random_seed): set seed in this. [ruby-core:28655]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e03b66ef18
commit
1bf3ca494f
3 changed files with 37 additions and 6 deletions
|
@ -387,4 +387,14 @@ END
|
|||
r2.rand(0x100)
|
||||
assert(r1 == r2)
|
||||
end
|
||||
|
||||
def test_fork_shuffle
|
||||
pid = fork do
|
||||
(1..10).to_a.shuffle
|
||||
raise 'default seed is not set' if srand == 0
|
||||
end
|
||||
p2, st = Process.waitpid2(pid)
|
||||
assert(st.success?)
|
||||
rescue NotImplementedError, ArgumentError
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue