aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-02 22:25:49 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-02 22:25:49 +0000
commitd0a98a0e90c9ff969da0c477f0f4cedb018b54b1 (patch)
tree74011f43cbace0fcd4e9cb3c575cf3609ce187c6 /test
parent7cf6ecd9de34ce5d51e9ef71d30a1ae44e6f9536 (diff)
downloadruby-d0a98a0e90c9ff969da0c477f0f4cedb018b54b1.tar.gz
* array.c (rb_ary_product): Test for reentry
* test/ruby/test_array.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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