summaryrefslogtreecommitdiff
path: root/test/uri/test_generic.rb
diff options
context:
space:
mode:
authorakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-13 10:50:26 +0000
committerakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-13 10:50:26 +0000
commitf461a6b8e532826e52fcbae8dcfdaecd55f3fc48 (patch)
tree0026f6339e6acd573e2681466865108d45a7a52a /test/uri/test_generic.rb
parentdb850b21fd6550f102fb5e7a322774788be96757 (diff)
* 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
Diffstat (limited to 'test/uri/test_generic.rb')
-rw-r--r--test/uri/test_generic.rb27
1 files changed, 27 insertions, 0 deletions
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