diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-28 16:50:53 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2023-03-29 15:27:07 +0900 |
commit | 8ce4ab146498879b65e22f1be951b25eebb79300 (patch) | |
tree | 21b8a9dbf9ec2e768b8b6c9899436267195d4b22 /test | |
parent | d9d95540e0f4a580b9bc58afac229162138926e6 (diff) |
Merge URI-0.12.1
Diffstat (limited to 'test')
-rw-r--r-- | test/uri/test_common.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb index 038f483a83..245b3d8cc3 100644 --- a/test/uri/test_common.rb +++ b/test/uri/test_common.rb @@ -112,6 +112,17 @@ class TestCommon < Test::Unit::TestCase assert_raise(NoMethodError) { Object.new.URI("http://www.ruby-lang.org/") } end + def test_parse_timeout + pre = ->(n) { + 'https://example.com/dir/' + 'a' * (n * 100) + '/##.jpg' + } + assert_linear_performance((1..10).map {|i| i * 100}, pre: pre) do |uri| + assert_raise(URI::InvalidURIError) do + URI.parse(uri) + end + end + end + def test_encode_www_form_component assert_equal("%00+%21%22%23%24%25%26%27%28%29*%2B%2C-.%2F09%3A%3B%3C%3D%3E%3F%40" \ "AZ%5B%5C%5D%5E_%60az%7B%7C%7D%7E", |