diff options
author | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-13 10:50:26 +0000 |
---|---|---|
committer | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-13 10:50:26 +0000 |
commit | f461a6b8e532826e52fcbae8dcfdaecd55f3fc48 (patch) | |
tree | 0026f6339e6acd573e2681466865108d45a7a52a /test/uri/test_generic.rb | |
parent | db850b21fd6550f102fb5e7a322774788be96757 (diff) | |
download | ruby-f461a6b8e532826e52fcbae8dcfdaecd55f3fc48.tar.gz |
* 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.rb | 27 |
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 |