aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index d8ee3abb28..0bd138cc49 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -2389,7 +2389,7 @@ class TestArray < Test::Unit::TestCase
assert_equal([], a.rotate!(13))
assert_equal([], a.rotate!(-13))
a = [].freeze
- assert_raise_with_message(RuntimeError, /can't modify frozen/) {a.rotate!}
+ assert_raise_with_message(RuntimeError, /can\'t modify frozen/) {a.rotate!}
a = [1,2,3]
assert_raise(ArgumentError) { a.rotate!(1, 1) }
end
@@ -2428,4 +2428,27 @@ class TestArray < Test::Unit::TestCase
assert_include([4, 7], a.bsearch {|x| (2**100).coerce((1 - x / 4) * (2**100)).first })
end
+
+ def test_shared_marking
+ assert_normal_exit <<-EOS, '[Bug #9718]'
+ begin
+ require 'timeout'
+ timeout(5) do
+ queue = []
+ i = 0
+ srand(0)
+ loop do
+ if (i+=1) > rand(100_000)
+ GC.verify_internal_consistency
+ queue.shift.call
+ i = 0
+ end
+ queue << lambda{}
+ end
+ end
+ rescue TimeoutError
+ assert(true)
+ end
+ EOS
+ end
end