diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-29 00:36:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-29 00:36:33 +0000 |
commit | 6bb52d8026b8c5b27f0f48dcfe7ac4e6e62a7428 (patch) | |
tree | f3255592b354e3fd7cbc48c8e074c9e7919d436b /test/ruby | |
parent | 84e90deb0e42872da39691ca4262d6b33845daa9 (diff) | |
download | ruby-6bb52d8026b8c5b27f0f48dcfe7ac4e6e62a7428.tar.gz |
test/ruby: suppress warnings
* test/ruby/test_array.rb: (need_continuation): suppress warnings
to require continuation.
* test/ruby/test_continuation.rb: ditto.
* test/ruby/test_enum.rb: ditto.
* test/ruby/test_fiber.rb: ditto.
* test/ruby/test_hash.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_array.rb | 23 | ||||
-rw-r--r-- | test/ruby/test_continuation.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_enum.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_fiber.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_hash.rb | 2 |
5 files changed, 19 insertions, 12 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 diff --git a/test/ruby/test_continuation.rb b/test/ruby/test_continuation.rb index 81125183ff..8d57b8bc25 100644 --- a/test/ruby/test_continuation.rb +++ b/test/ruby/test_continuation.rb @@ -1,5 +1,5 @@ require 'test/unit' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} require 'fiber' class TestContinuation < Test::Unit::TestCase diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index 8bcf929690..532d1b965a 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -1,5 +1,5 @@ require 'test/unit' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} require 'stringio' class TestEnumerable < Test::Unit::TestCase diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 7b5ce8190f..4684a65a03 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -1,6 +1,6 @@ require 'test/unit' require 'fiber' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} require 'tmpdir' class TestFiber < Test::Unit::TestCase diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index da07df94b6..d769ef89e7 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -1,6 +1,6 @@ # -*- coding: us-ascii -*- require 'test/unit' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} class TestHash < Test::Unit::TestCase |