diff options
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 4116736fcf..0a4b1379f1 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -805,7 +805,7 @@ class TestArray < Test::Unit::TestCase end def test_flatten_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation o = Object.new def o.to_ary() callcc {|k| @cont = k; [1,2,3]} end begin @@ -819,7 +819,7 @@ class TestArray < Test::Unit::TestCase end def test_permutation_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation n = 1000 cont = nil ary = [1,2,3] @@ -836,7 +836,7 @@ class TestArray < Test::Unit::TestCase end def test_product_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation n = 1000 cont = nil ary = [1,2,3] @@ -853,7 +853,7 @@ class TestArray < Test::Unit::TestCase end def test_combination_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation n = 1000 cont = nil ary = [1,2,3] @@ -870,7 +870,7 @@ class TestArray < Test::Unit::TestCase end def test_repeated_permutation_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation n = 1000 cont = nil ary = [1,2,3] @@ -887,7 +887,7 @@ class TestArray < Test::Unit::TestCase end def test_repeated_combination_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation n = 1000 cont = nil ary = [1,2,3] @@ -1365,7 +1365,7 @@ class TestArray < Test::Unit::TestCase end def test_sort_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation n = 1000 cont = nil ary = (1..100).to_a @@ -2030,7 +2030,7 @@ class TestArray < Test::Unit::TestCase end def test_reject_with_callcc - respond_to?(:callcc, true) or require 'continuation' + need_continuation bug9727 = '[ruby-dev:48101] [Bug #9727]' cont = nil a = [*1..10].reject do |i| @@ -2495,4 +2495,11 @@ class TestArray < Test::Unit::TestCase skip e.message end end + + private + def need_continuation + unless respond_to?(:callcc, true) + EnvUtil.suppress_warning {require 'continuation'} + end + end end |