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.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 8208b3a2a4..6c84b9238b 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -780,6 +780,23 @@ class TestArray < Test::Unit::TestCase
assert_match(/reentered/, e.message)
end
+ def test_product_with_callcc
+ respond_to?(:callcc, true) or require 'continuation'
+ n = 1000
+ cont = nil
+ ary = [1,2,3]
+ begin
+ ary.product {
+ callcc {|k| cont = k} unless cont
+ }
+ rescue => e
+ end
+ n -= 1
+ cont.call if 0 < n
+ assert_instance_of(RuntimeError, e)
+ assert_match(/reentered/, e.message)
+ end
+
def test_combination_with_callcc
respond_to?(:callcc, true) or require 'continuation'
n = 1000