diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-08-29 11:09:22 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-08-29 11:10:45 +0900 |
commit | d92289cd8d5cac784ae856fb777f10dbc9f91b62 (patch) | |
tree | 7d2bd38521859d94a7c9bca3ec63104225e551c9 /test/ruby | |
parent | cd0e208963bdf9ee2fec30e83bdc8f6bc77a7b8d (diff) |
Revert "Remove warnings of flip-flop deprecation from tests and specs"
This reverts commit bf7a32d22079cc44eb19794e41d82b886d5d17b3.
flip-flop is no longer deprecated.
[Feature #5400]
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_flip.rb | 14 | ||||
-rw-r--r-- | test/ruby/test_jit.rb | 3 |
2 files changed, 2 insertions, 15 deletions
diff --git a/test/ruby/test_flip.rb b/test/ruby/test_flip.rb index 9156be0553..9c58f5f497 100644 --- a/test/ruby/test_flip.rb +++ b/test/ruby/test_flip.rb @@ -2,16 +2,7 @@ require 'test/unit' class TestFlip < Test::Unit::TestCase - def setup - @verbose_bak, $VERBOSE = $VERBOSE, nil - end - - def teardown - $VERBOSE = @verbose_bak - end - def test_flip_flop - eval <<-END assert_equal [4,5], (1..9).select {|n| true if (n==4)..(n==5)} assert_equal [4,5], (1..9).select {|n| true if (n==4)...(n==5)} assert_equal [2], (1..9).select {|n| true if (n==2)..(n%2).zero?} @@ -19,7 +10,6 @@ class TestFlip < Test::Unit::TestCase assert_equal [4,5,7,8], (1..9).select {|n| true if (n==4)...(n==5) or (n==7)...(n==8)} assert_equal [nil, 2, 3, 4, nil], (1..5).map {|x| x if (x==2..x==4)} assert_equal [1, nil, nil, nil, 5], (1..5).map {|x| x if !(x==2..x==4)} - END end def test_hidden_key @@ -35,14 +25,14 @@ class TestFlip < Test::Unit::TestCase def test_shared_eval bug7671 = '[ruby-core:51296]' vs = (1..9).to_a - eval("vs.select {|n| if n==2..n==16 then 1 end}") + vs.select {|n| if n==2..n==16 then 1 end} v = eval("vs.select {|n| if n==3..n==6 then 1 end}") assert_equal([*3..6], v, bug7671) vs end def test_shared_thread - ff = eval("proc {|n| true if n==3..n==5}") + ff = proc {|n| true if n==3..n==5} v = 1..9 a = true th = Thread.new { diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index c9255f20b0..0274f59252 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -112,13 +112,10 @@ class TestJIT < Test::Unit::TestCase end def test_compile_insn_setspecial - verbose_bak, $VERBOSE = $VERBOSE, nil assert_compile_once("#{<<~"begin;"}\n#{<<~"end;"}", result_inspect: 'true', insns: %i[setspecial]) begin; true if nil.nil?..nil.nil? end; - ensure - $VERBOSE = verbose_bak end def test_compile_insn_instancevariable |