From f461a6b8e532826e52fcbae8dcfdaecd55f3fc48 Mon Sep 17 00:00:00 2001 From: akira Date: Tue, 13 Jul 2004 10:50:26 +0000 Subject: * lib/uri/generic.rb (URI::Generic#merge_path): "URI('http://www.example.com/foo/..') + './'" should return "URI('http://www.example.com/')". [ruby-list:39838] "URI('http://www.example.com/') + './foo/bar/..'" should return "URI('http://www.example.com/foo/')". [ruby-list:39844] * test/uri/test_generic.rb (TestGeneric#test_merge): added tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/uri/test_generic.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test') diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index 770a6f6151..8740574e4e 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -163,6 +163,33 @@ class TestGeneric < Test::Unit::TestCase u0 = URI.parse('mailto:foo@example.com') u1 = URI.parse('mailto:foo@example.com#bar') assert_equal(uri_to_ary(u0 + '#bar'), uri_to_ary(u1)) + + # [ruby-list:39838] + u0 = URI.parse('http://www.example.com/') + u1 = URI.parse('http://www.example.com/foo/..') + './' + assert_equal(u0, u1) + u0 = URI.parse('http://www.example.com/foo/') + u1 = URI.parse('http://www.example.com/foo/bar/..') + './' + assert_equal(u0, u1) + u0 = URI.parse('http://www.example.com/foo/bar/') + u1 = URI.parse('http://www.example.com/foo/bar/baz/..') + './' + assert_equal(u0, u1) + u0 = URI.parse('http://www.example.com/') + u1 = URI.parse('http://www.example.com/foo/bar/../..') + './' + assert_equal(u0, u1) + u0 = URI.parse('http://www.example.com/foo/') + u1 = URI.parse('http://www.example.com/foo/bar/baz/../..') + './' + assert_equal(u0, u1) + + # [ruby-list:39844] + u = URI.parse('http://www.example.com/') + u0 = u + './foo/' + u1 = u + './foo/bar/..' + assert_equal(u0, u1) + u = URI.parse('http://www.example.com/') + u0 = u + './' + u1 = u + './foo/bar/../..' + assert_equal(u0, u1) end def test_route -- cgit v1.2.3