summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 04:22:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 04:22:12 +0000
commit71eddb1dea82226a31540de2982ddfc0288cbbf4 (patch)
tree2f09283d982f581f707b494b7a803c2a5aef5caf /test
parent29707c1d73f35c15d118ea5ca2330e85ac475dd6 (diff)
parse.y: warn assigned but unused in toplevel
* parse.y (local_push_gen): warn assigned but unused variables also in toplevel, except for -e option. [Feature #7730] [ruby-core:51580] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rubyoptions.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 950fdd6922..c12ddb9f2e 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -551,6 +551,8 @@ class TestRubyOptions < Test::Unit::TestCase
assert_in_out_err(["-we", "def foo\n _a=1\nend"], "", [], [], feature6693)
bug7408 = '[ruby-core:49659]'
assert_in_out_err(["-we", "def foo\n a=1\n :a\nend"], "", [], ["-e:2: warning: assigned but unused variable - a"], bug7408)
+ feature7730 = '[ruby-core:51580]'
+ assert_in_out_err(["-w", "-"], "a=1", [], ["-:1: warning: assigned but unused variable - a"], feature7730)
end
def test_shadowing_variable