diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_parse.rb | 6 | ||||
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 14 |
2 files changed, 2 insertions, 18 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 6160aa1452..c7aeeecb61 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -911,10 +911,8 @@ x = __ENCODING__ assert_equal(expected, actual, bug5614) end - def test_shadowing_variable - assert_warning(/shadowing outer local variable/) {eval("a=1; tap {|a|}")} - a = "\u{3042}" - assert_warning(/#{a}/o) {eval("#{a}=1; tap {|#{a}|}")} + def test_no_shadowing_variable_warning + assert_no_warning(/shadowing outer local variable/) {eval("a=1; tap {|a|}")} end def test_unused_variable diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 4a26d6bfc7..69521b1d23 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -782,20 +782,6 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err(["-w", "-"], "eval('a=1')", [], [], feature7730) end - def test_shadowing_variable - bug4130 = '[ruby-dev:42718]' - assert_in_out_err(["-we", "def foo\n"" a=1\n"" 1.times do |a| end\n"" a\n""end"], - "", [], ["-e:3: warning: shadowing outer local variable - a"], bug4130) - assert_in_out_err(["-we", "def foo\n"" a=1\n"" 1.times do |a| end\n""end"], - "", [], - ["-e:3: warning: shadowing outer local variable - a", - "-e:2: warning: assigned but unused variable - a", - ], bug4130) - feature6693 = '[ruby-core:46160]' - assert_in_out_err(["-we", "def foo\n"" _a=1\n"" 1.times do |_a| end\n""end"], - "", [], [], feature6693) - end - def test_script_from_stdin begin require 'pty' |