mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
eddfa31bda
commit
88e326edda
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue