diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-11 06:50:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-11 06:50:29 +0000 |
commit | 88e326eddaf90dd628d4b2ef013301ecc231b9b7 (patch) | |
tree | a5ab7191dc2ebb2e2a386bf3304c5b53f91ce34c /test | |
parent | eddfa31bda3a06c857217cbc09050cda920f1c7f (diff) | |
download | ruby-88e326eddaf90dd628d4b2ef013301ecc231b9b7.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |