[前][次][番号順一覧][スレッド一覧]

ruby-changes:24283

From: nobu <ko1@a...>
Date: Sun, 8 Jul 2012 06:37:23 +0900 (JST)
Subject: [ruby-changes:24283] nobu:r36334 (trunk): test/ruby/test_rubyoptions.rb: tests for another name

nobu	2012-07-08 06:36:08 +0900 (Sun, 08 Jul 2012)

  New Revision: 36334

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36334

  Log:
    test/ruby/test_rubyoptions.rb: tests for another name
    
    * test/ruby/test_rubyoptions.rb (test_{unused,shadowing_variable):
      tests for another name.

  Modified files:
    trunk/test/ruby/test_rubyoptions.rb

Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb	(revision 36333)
+++ test/ruby/test_rubyoptions.rb	(revision 36334)
@@ -497,6 +497,7 @@
     assert_in_out_err(["-we", "1.times do\n  a=1\nend"], "", [], [], feature3446)
     assert_in_out_err(["-we", "def foo\n  1.times do\n    a=1\n  end\nend"], "", [], ["-e:3: warning: assigned but unused variable - a"], feature3446)
     assert_in_out_err(["-we", "def foo\n""  1.times do |a| end\n""end"], "", [], [])
+    assert_in_out_err(["-we", "def foo\n  _a=1\nend"], "", [], ["-e:2: warning: assigned but unused variable - _a"], feature3446)
   end
 
   def test_shadowing_variable
@@ -508,6 +509,11 @@
                       ["-e:3: warning: shadowing outer local variable - a",
                        "-e:2: warning: assigned but unused 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)
   end
 
   def test_script_from_stdin

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]