diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-26 03:08:10 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-26 03:08:10 +0000 |
commit | b171d9204637e3790fce7bfb32fe9a54014d8301 (patch) | |
tree | 51e6ad07ad00e4aac1f1e2976b37d7585c07fecb /test/ripper/test_parser_events.rb | |
parent | 7f69d4e41f1cd77e142b786596dd005891a233f3 (diff) | |
download | ruby-b171d9204637e3790fce7bfb32fe9a54014d8301.tar.gz |
Revert "parse.y: remove "shadowing outer local variable" warning"
I forgot to add the copyright of the patch...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r-- | test/ripper/test_parser_events.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index 95ec661fcf..a420bfbf81 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -1487,6 +1487,13 @@ class TestRipper::ParserEvents < Test::Unit::TestCase assert_equal("`$' without identifiers is not allowed as a global variable name", compile_error('$')) end + def test_warning_shadowing + fmt, *args = warning("x = 1; tap {|;x|}") + assert_match(/shadowing outer local variable/, fmt) + assert_equal("x", args[0]) + assert_match(/x/, fmt % args) + end + def test_warning_ignored_magic_comment fmt, *args = warning("1; #-*- frozen-string-literal: true -*-") assert_match(/ignored after any tokens/, fmt) |