1 Canonicalization of standard URLs 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6 PASS canonicalize('http://www.google.com/foo?bar=baz#') is 'http://www.google.com/foo?bar=baz#' 7 PASS canonicalize('http://[www.google.com]/') is 'http://[www.google.com]/' 8 FAIL canonicalize('http:////////user:@google.com:99?foo') should be http://user@google.com:99/?foo. Was http://////user:@google.com:99?foo. 9 FAIL canonicalize('http://192.0x00A80001') should be http://192.168.0.1/. Was http://192.0x00A80001/. 10 FAIL canonicalize('http://www/foo%2Ehtml') should be http://www/foo.html. Was http://www/foo%2Ehtml. 11 PASS canonicalize('http://user:pass@/') is 'http://user:pass@/' 12 PASS canonicalize('http://%25DOMAIN:foobar@foodomain.com/') is 'http://%25DOMAIN:foobar@foodomain.com/' 13 PASS canonicalize('http:\\\\www.google.com\\foo') is 'http://www.google.com/foo' 14 FAIL canonicalize('http://www.google.com/asdf#\ud800') should be http://www.google.com/asdf#. Was http://www.google.com/asdf#%26%2355296%3B. 15 PASS canonicalize('http://foo:80/') is 'http://foo/' 16 PASS canonicalize('http://foo:81/') is 'http://foo:81/' 17 PASS canonicalize('httpa://foo:80/') is 'httpa://foo:80/' 18 PASS canonicalize('http://foo:-80/') is 'http://foo:-80/' 19 PASS canonicalize('https://foo:443/') is 'https://foo/' 20 PASS canonicalize('https://foo:80/') is 'https://foo:80/' 21 PASS canonicalize('ftp://foo:21/') is 'ftp://foo/' 22 PASS canonicalize('ftp://foo:80/') is 'ftp://foo:80/' 23 PASS canonicalize('gopher://foo:70/') is 'gopher://foo/' 24 PASS canonicalize('gopher://foo:443/') is 'gopher://foo:443/' 25 PASS canonicalize('ws://foo:80/') is 'ws://foo/' 26 PASS canonicalize('ws://foo:81/') is 'ws://foo:81/' 27 PASS canonicalize('ws://foo:443/') is 'ws://foo:443/' 28 PASS canonicalize('ws://foo:815/') is 'ws://foo:815/' 29 PASS canonicalize('wss://foo:80/') is 'wss://foo:80/' 30 PASS canonicalize('wss://foo:81/') is 'wss://foo:81/' 31 PASS canonicalize('wss://foo:443/') is 'wss://foo/' 32 PASS canonicalize('wss://foo:815/') is 'wss://foo:815/' 33 PASS successfullyParsed is true 34 35 TEST COMPLETE 36 37