Test for relative URL with a port in the base URL.
As expected, the port is preserved.
This commit is contained in:
@@ -252,9 +252,15 @@ UrlTest::RelativeUriTest()
|
|||||||
};
|
};
|
||||||
|
|
||||||
const RelativeUrl tests[] = {
|
const RelativeUrl tests[] = {
|
||||||
|
// The port must be preserved
|
||||||
|
{"http://host:81/", "/path", "http://host:81/path"},
|
||||||
|
|
||||||
|
// Tests from http://skew.org/uri/uri_tests.html
|
||||||
{"http://example.com/path?query#frag", "",
|
{"http://example.com/path?query#frag", "",
|
||||||
"http://example.com/path?query"},
|
"http://example.com/path?query"},
|
||||||
{"foo:a/b", "../c", "foo:/c"},
|
// The fragment must be dropped when changing the path, but the
|
||||||
|
// query must be preserved
|
||||||
|
{"foo:a/b", "../c", "foo:/c"},
|
||||||
// foo:c would be more intuitive, and is what skew.org tests.
|
// foo:c would be more intuitive, and is what skew.org tests.
|
||||||
// However, foo:/c is what the RFC says we should get.
|
// However, foo:/c is what the RFC says we should get.
|
||||||
{"foo:a", "foo:.", "foo:"},
|
{"foo:a", "foo:.", "foo:"},
|
||||||
@@ -533,7 +539,7 @@ void
|
|||||||
UrlTest::IDNTest()
|
UrlTest::IDNTest()
|
||||||
{
|
{
|
||||||
// http://www.w3.org/2004/04/uri-rel-test.html
|
// http://www.w3.org/2004/04/uri-rel-test.html
|
||||||
// TODO these need to be manually UrlDecoded with ou API.
|
// TODO these need to be manually UrlDecoded with our API.
|
||||||
// We also need to decide wether to store them as UTF-8 or IDNA/punycode.
|
// We also need to decide wether to store them as UTF-8 or IDNA/punycode.
|
||||||
NextSubTest();
|
NextSubTest();
|
||||||
CPPUNIT_ASSERT_EQUAL(BUrl("http://www.w3.org").UrlString(),
|
CPPUNIT_ASSERT_EQUAL(BUrl("http://www.w3.org").UrlString(),
|
||||||
|
|||||||
Reference in New Issue
Block a user