blob: e34967f0424fb62e168f20ae5cceffe9b507adc5 [file] [log] [blame]
Test resolution of relative URLs.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS canonicalize('http://another/') is 'http://another/'
PASS canonicalize('http:////another/') is 'http://another/'
PASS canonicalize('') is 'http://foo/bar'
PASS canonicalize('') is 'http://foo/bar'
PASS canonicalize('') is 'http://foo/bar'
PASS canonicalize(' another ') is 'http://foo/another'
PASS canonicalize(' . ') is 'http://foo/'
PASS canonicalize(' ') is 'http://foo/bar'
PASS canonicalize('http:path') is 'http://host/path'
PASS canonicalize('http:path') is 'http://host/a/path'
PASS canonicalize('http:/path') is 'http://host/path'
PASS canonicalize('HTTP:/path') is 'http://host/path'
PASS canonicalize('https:host2') is 'https://host2/'
PASS canonicalize('htto:/host2') is 'htto:/host2'
PASS canonicalize('/b/c/d') is 'http://host/b/c/d'
PASS canonicalize('\\b\\c\\d') is 'http://host/b/c/d'
PASS canonicalize('/b/../c') is 'http://host/c'
PASS canonicalize('/b/../c') is 'http://host/c'
PASS canonicalize('\\b/../c?x#y') is 'http://host/c?x#y'
PASS canonicalize('/b/../c?x#y') is 'http://host/c?x#y'
PASS canonicalize('b') is 'http://host/b'
PASS canonicalize('bc/de') is 'http://host/bc/de'
PASS canonicalize('bc/de?query#ref') is 'http://host/a/bc/de?query#ref'
PASS canonicalize('.') is 'http://host/a/'
PASS canonicalize('..') is 'http://host/'
PASS canonicalize('./..') is 'http://host/'
PASS canonicalize('../.') is 'http://host/'
PASS canonicalize('././.') is 'http://host/a/'
PASS canonicalize('../../../foo') is 'http://host/foo'
PASS canonicalize('?foo=bar') is 'http://host/a?foo=bar'
PASS canonicalize('?') is 'http://host/a?'
PASS canonicalize('?foo=bar#com') is 'http://host/a?foo=bar#com'
PASS canonicalize('#ref') is 'http://host/a#ref'
PASS canonicalize('#') is 'http://host/a#'
PASS canonicalize('#bye') is 'http://host/a?foo=bar#bye'
PASS canonicalize('./asd:fgh') is 'http://foo/asd:fgh'
PASS canonicalize(':foo') is 'http://foo/:foo'
PASS canonicalize(' hello world') is 'http://foo/hello%20world'
PASS canonicalize(';foo') is 'http://host/;foo'
PASS canonicalize(';foo') is 'http://host/;foo'
PASS canonicalize(';/../bar') is 'http://host/bar'
PASS canonicalize('//another') is 'http://another/'
PASS canonicalize('//another/path?query#ref') is 'http://another/path?query#ref'
PASS canonicalize('///another/path') is 'http://another/path'
PASS canonicalize('//Another\\path') is 'http://another/path'
PASS canonicalize('//') is 'http:'
PASS canonicalize('\\/another/path') is 'http://another/path'
PASS canonicalize('/\\Another\\path') is 'http://another/path'
PASS successfullyParsed is true
TEST COMPLETE