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

ruby-changes:25089

From: nobu <ko1@a...>
Date: Thu, 11 Oct 2012 15:50:40 +0900 (JST)
Subject: [ruby-changes:25089] nobu:r37141 (trunk): test_string.rb: suppress warnings

nobu	2012-10-11 15:50:29 +0900 (Thu, 11 Oct 2012)

  New Revision: 37141

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

  Log:
    test_string.rb: suppress warnings
    
    * test/ruby/test_string.rb (test_match_method): use unique objects in
      TestString and TestString2.
    
    * test/ruby/test_string.rb (test_ascii_incomat_inspect): suppress
      warnings.

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

Index: test/ruby/test_string.rb
===================================================================
--- test/ruby/test_string.rb	(revision 37140)
+++ test/ruby/test_string.rb	(revision 37141)
@@ -1827,7 +1827,7 @@
   def test_match_method
     assert_equal("bar", "foobarbaz".match(/bar/).to_s)
 
-    o = /foo/
+    o = Regexp.new('foo')
     def o.match(x, y, z); x + y + z; end
     assert_equal("foobarbaz", "foo".match(o, "bar", "baz"))
     x = nil
@@ -1983,11 +1983,15 @@
       assert_equal('"ab\\"c"', "ab\"c".encode(e).inspect, bug4081)
     end
     begin
+      verbose, $VERBOSE = $VERBOSE, nil
       ext = Encoding.default_external
       Encoding.default_external = "us-ascii"
+      $VERBOSE = verbose
       i = "abc\"\\".force_encoding("utf-8").inspect
     ensure
+      $VERBOSE = nil
       Encoding.default_external = ext
+      $VERBOSE = verbose
     end
     assert_equal('"abc\\"\\\\"', i, bug4081)
   end

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

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