From 2e0f73f05e9ad226356a2dde89f53feb41d59cc9 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 18 Jul 2024 10:27:25 +0900 Subject: [PATCH] Rename and switch RFC2396_PARSER test --- test/uri/test_parser.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/uri/test_parser.rb b/test/uri/test_parser.rb index f400de2..9105d47 100644 --- a/test/uri/test_parser.rb +++ b/test/uri/test_parser.rb @@ -33,7 +33,9 @@ def test_compare assert(!u2.equal?(u3)) end - def test_parse + def test_parse_rfc2396_parser + URI.parser = URI::RFC2396_PARSER + escaped = URI::REGEXP::PATTERN::ESCAPED hex = URI::REGEXP::PATTERN::HEX p1 = URI::Parser.new(:ESCAPED => "(?:#{escaped}|%u[#{hex}]{4})") @@ -43,6 +45,8 @@ def test_parse u1.path = '/%uDCBA' assert_equal(['http', nil, 'a', URI::HTTP.default_port, '/%uDCBA', nil, nil], uri_to_ary(u1)) + ensure + URI.parser = URI::DEFAULT_PARSER end def test_parse_query_pct_encoded