From 88e326eddaf90dd628d4b2ef013301ecc231b9b7 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 11 Oct 2012 06:50:29 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 9fcde4bcf5..823c5c7c6d 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1827,7 +1827,7 @@ class TestString < Test::Unit::TestCase 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 @@ class TestString < Test::Unit::TestCase 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 -- cgit v1.2.3