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

ruby-changes:32340

From: nobu <ko1@a...>
Date: Wed, 25 Dec 2013 22:44:10 +0900 (JST)
Subject: [ruby-changes:32340] nobu:r44419 (trunk): test_keyword.rb: suppress warnings

nobu	2013-12-25 22:44:05 +0900 (Wed, 25 Dec 2013)

  New Revision: 44419

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

  Log:
    test_keyword.rb: suppress warnings
    
    * test/ruby/test_keyword.rb (test_block_required_keyword): suppress
      shadowing outer variable warning.
    
    * test/ruby/test_keyword.rb (test_precedence_of_keyword_arguments):
      suppress unused variable warning.

  Modified files:
    trunk/test/ruby/test_keyword.rb
Index: test/ruby/test_keyword.rb
===================================================================
--- test/ruby/test_keyword.rb	(revision 44418)
+++ test/ruby/test_keyword.rb	(revision 44419)
@@ -321,7 +321,7 @@ class TestKeywordArguments < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L321
   def test_block_required_keyword
     feature7701 = '[ruby-core:51454] [Feature #7701] required keyword argument'
     b = assert_nothing_raised(SyntaxError, feature7701) do
-      break eval("proc {|a:| a}")
+      break eval("proc {|a:| a}", nil, __FILE__, __LINE__)
     end
     assert_raise_with_message(ArgumentError, /missing keyword/, feature7701) {b.call}
     assert_raise_with_message(ArgumentError, /unknown keyword/, feature7701) {b.call(a:0, b:1)}
@@ -330,11 +330,11 @@ class TestKeywordArguments < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L330
 
     bug8139 = '[ruby-core:53608] [Bug #8139] required keyword argument with rest hash'
     b = assert_nothing_raised(SyntaxError, feature7701) do
-      break eval("proc {|a:, **b| [a, b]}")
+      break eval("proc {|a:, **bl| [a, bl]}", nil, __FILE__, __LINE__)
     end
     assert_equal([42, {}], b.call(a: 42), feature7701)
     assert_equal([42, {c: feature7701}], b.call(a: 42, c: feature7701), feature7701)
-    assert_equal([[:keyreq, :a], [:keyrest, :b]], b.parameters, feature7701)
+    assert_equal([[:keyreq, :a], [:keyrest, :bl]], b.parameters, feature7701)
     assert_raise_with_message(ArgumentError, /missing keyword/, bug8139) {b.call(c: bug8139)}
     assert_raise_with_message(ArgumentError, /missing keyword/, bug8139) {b.call}
   end
@@ -398,7 +398,7 @@ class TestKeywordArguments < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L398
       end
     end
     assert_equal([{}, {}], a.new.foo({}))
-    assert_equal([{}, {:bar=>"x"}], a.new.foo({}, bar: "x"))
+    assert_equal([{}, {:bar=>"x"}], a.new.foo({}, bar: "x"), bug8040)
   end
 
   def test_precedence_of_keyword_arguments_with_post_argument

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

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