1Test resolution of relative URLs. 2 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6PASS canonicalize('http://another/') is 'http://another/' 7PASS canonicalize('http:////another/') is 'http://another/' 8PASS canonicalize('') is 'http://foo/bar' 9PASS canonicalize('') is 'http://foo/bar' 10PASS canonicalize('') is 'http://foo/bar' 11PASS canonicalize(' another ') is 'http://foo/another' 12PASS canonicalize(' . ') is 'http://foo/' 13PASS canonicalize(' ') is 'http://foo/bar' 14PASS canonicalize('http:path') is 'http://host/path' 15PASS canonicalize('http:path') is 'http://host/a/path' 16FAIL canonicalize('http:/path') should be http://host/path. Was http:/path. 17FAIL canonicalize('HTTP:/path') should be http://host/path. Was http:/path. 18FAIL canonicalize('https:host2') should be https://host2/. Was https:host2. 19PASS canonicalize('htto:/host2') is 'htto:/host2' 20PASS canonicalize('/b/c/d') is 'http://host/b/c/d' 21PASS canonicalize('\\b\\c\\d') is 'http://host/b/c/d' 22PASS canonicalize('/b/../c') is 'http://host/c' 23PASS canonicalize('/b/../c') is 'http://host/c' 24PASS canonicalize('\\b/../c?x#y') is 'http://host/c?x#y' 25PASS canonicalize('/b/../c?x#y') is 'http://host/c?x#y' 26PASS canonicalize('b') is 'http://host/b' 27PASS canonicalize('bc/de') is 'http://host/bc/de' 28PASS canonicalize('bc/de?query#ref') is 'http://host/a/bc/de?query#ref' 29PASS canonicalize('.') is 'http://host/a/' 30PASS canonicalize('..') is 'http://host/' 31PASS canonicalize('./..') is 'http://host/' 32PASS canonicalize('../.') is 'http://host/' 33PASS canonicalize('././.') is 'http://host/a/' 34PASS canonicalize('../../../foo') is 'http://host/foo' 35PASS canonicalize('?foo=bar') is 'http://host/a?foo=bar' 36PASS canonicalize('?') is 'http://host/a?' 37PASS canonicalize('?foo=bar#com') is 'http://host/a?foo=bar#com' 38PASS canonicalize('#ref') is 'http://host/a#ref' 39PASS canonicalize('#') is 'http://host/a#' 40PASS canonicalize('#bye') is 'http://host/a?foo=bar#bye' 41FAIL canonicalize('baz.html') should be . Was baz.html. 42PASS canonicalize('data:baz') is 'data:baz' 43PASS canonicalize('data:/base') is 'data:/base' 44PASS canonicalize('http://host/') is 'http://host/' 45FAIL canonicalize('http:host') should be http://host/. Was http:host. 46PASS canonicalize('./asd:fgh') is 'http://foo/asd:fgh' 47PASS canonicalize(':foo') is 'http://foo/:foo' 48PASS canonicalize(' hello world') is 'http://foo/hello%20world' 49FAIL canonicalize(':foo') should be . Was :foo. 50PASS canonicalize(';foo') is 'http://host/;foo' 51PASS canonicalize(';foo') is 'http://host/;foo' 52PASS canonicalize(';/../bar') is 'http://host/bar' 53PASS canonicalize('//another') is 'http://another/' 54PASS canonicalize('//another/path?query#ref') is 'http://another/path?query#ref' 55FAIL canonicalize('///another/path') should be http://another/path. Was http:/another/path. 56FAIL canonicalize('//Another\\path') should be http://another/path. Was http://Another/path. 57FAIL canonicalize('//') should be http:. Was http:/. 58PASS canonicalize('\\/another/path') is 'http://another/path' 59FAIL canonicalize('/\\Another\\path') should be http://another/path. Was http://Another/path. 60PASS successfullyParsed is true 61 62TEST COMPLETE 63 64