summaryrefslogtreecommitdiff
path: root/test/ruby/test_rand.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_rand.rb')
-rw-r--r--test/ruby/test_rand.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb
index b6563954cf..97ac8147bd 100644
--- a/test/ruby/test_rand.rb
+++ b/test/ruby/test_rand.rb
@@ -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