1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

suppress warnings: URI.regexp is obsolete

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2014-06-27 06:25:44 +00:00
parent b0bc563550
commit 36a043a93a

View file

@ -33,17 +33,19 @@ class TestCommon < Test::Unit::TestCase
end
def test_regexp
assert_instance_of Regexp, URI.regexp
assert_instance_of Regexp, URI.regexp(['http'])
assert_equal URI.regexp, URI.regexp
assert_equal 'http://', 'x http:// x'.slice(URI.regexp)
assert_equal 'http://', 'x http:// x'.slice(URI.regexp(['http']))
assert_equal 'http://', 'x http:// x ftp://'.slice(URI.regexp(['http']))
assert_equal nil, 'http://'.slice(URI.regexp([]))
assert_equal nil, ''.slice(URI.regexp)
assert_equal nil, 'xxxx'.slice(URI.regexp)
assert_equal nil, ':'.slice(URI.regexp)
assert_equal 'From:', 'From:'.slice(URI.regexp)
EnvUtil.suppress_warning do
assert_instance_of Regexp, URI.regexp
assert_instance_of Regexp, URI.regexp(['http'])
assert_equal URI.regexp, URI.regexp
assert_equal 'http://', 'x http:// x'.slice(URI.regexp)
assert_equal 'http://', 'x http:// x'.slice(URI.regexp(['http']))
assert_equal 'http://', 'x http:// x ftp://'.slice(URI.regexp(['http']))
assert_equal nil, 'http://'.slice(URI.regexp([]))
assert_equal nil, ''.slice(URI.regexp)
assert_equal nil, 'xxxx'.slice(URI.regexp)
assert_equal nil, ':'.slice(URI.regexp)
assert_equal 'From:', 'From:'.slice(URI.regexp)
end
end
def test_kernel_uri