ruby-changes:36561
From: nobu <ko1@a...>
Date: Sat, 29 Nov 2014 09:36:44 +0900 (JST)
Subject: [ruby-changes:36561] nobu:r48642 (trunk): test/ruby: suppress warnings
nobu 2014-11-29 09:36:33 +0900 (Sat, 29 Nov 2014) New Revision: 48642 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48642 Log: 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. Modified files: trunk/test/ruby/test_array.rb trunk/test/ruby/test_continuation.rb trunk/test/ruby/test_enum.rb trunk/test/ruby/test_fiber.rb trunk/test/ruby/test_hash.rb Index: test/ruby/test_fiber.rb =================================================================== --- test/ruby/test_fiber.rb (revision 48641) +++ test/ruby/test_fiber.rb (revision 48642) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_fiber.rb#L1 require 'test/unit' require 'fiber' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} require 'tmpdir' class TestFiber < Test::Unit::TestCase Index: test/ruby/test_continuation.rb =================================================================== --- test/ruby/test_continuation.rb (revision 48641) +++ test/ruby/test_continuation.rb (revision 48642) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_continuation.rb#L1 require 'test/unit' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} require 'fiber' class TestContinuation < Test::Unit::TestCase Index: test/ruby/test_array.rb =================================================================== --- test/ruby/test_array.rb (revision 48641) +++ test/ruby/test_array.rb (revision 48642) @@ -805,7 +805,7 @@ class TestArray < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L805 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L819 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L836 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L853 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L870 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L887 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L1365 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L2030 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L2495 skip e.message end end + + private + def need_continuation + unless respond_to?(:callcc, true) + EnvUtil.suppress_warning {require 'continuation'} + end + end end Index: test/ruby/test_enum.rb =================================================================== --- test/ruby/test_enum.rb (revision 48641) +++ test/ruby/test_enum.rb (revision 48642) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_enum.rb#L1 require 'test/unit' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} require 'stringio' class TestEnumerable < Test::Unit::TestCase Index: test/ruby/test_hash.rb =================================================================== --- test/ruby/test_hash.rb (revision 48641) +++ test/ruby/test_hash.rb (revision 48642) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_hash.rb#L1 # -*- coding: us-ascii -*- require 'test/unit' -require 'continuation' +EnvUtil.suppress_warning {require 'continuation'} class TestHash < Test::Unit::TestCase -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/