blob: a7319de9b1fb80d6a88dc04db62d8266352a977f [file] [log] [blame]
Canonicalization of IPv6 addresses.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
FAIL canonicalize('http:///') should be http:. Was http:/.
PASS canonicalize('http://[/') is 'http://[/'
PASS canonicalize('http://[:/') is 'http://[:/'
PASS canonicalize('http://]/') is 'http://]/'
PASS canonicalize('http://:]/') is 'http://:]/'
PASS canonicalize('http://[]/') is 'http://[]/'
PASS canonicalize('http://[:]/') is 'http://[:]/'
PASS canonicalize('http://2001:db8::1/') is 'http://2001:db8::1/'
PASS canonicalize('http://[2001:db8::1/') is 'http://[2001:db8::1/'
PASS canonicalize('http://2001:db8::1]/') is 'http://2001:db8::1]/'
PASS canonicalize('http://[::]/') is 'http://[::]/'
PASS canonicalize('http://[::1]/') is 'http://[::1]/'
PASS canonicalize('http://[1::]/') is 'http://[1::]/'
FAIL canonicalize('http://[::192.168.0.1]/') should be http://[::c0a8:1]/. Was http://[::192.168.0.1]/.
FAIL canonicalize('http://[::ffff:192.168.0.1]/') should be http://[::ffff:c0a8:1]/. Was http://[::ffff:192.168.0.1]/.
FAIL canonicalize('http://[000:01:02:003:004:5:6:007]/') should be http://[0:1:2:3:4:5:6:7]/. Was http://[000:01:02:003:004:5:6:007]/.
FAIL canonicalize('http://[A:b:c:DE:fF:0:1:aC]/') should be http://[a:b:c:de:ff:0:1:ac]/. Was http://[A:b:c:DE:fF:0:1:aC]/.
FAIL canonicalize('http://[1:0:0:2::3:0]/') should be http://[1::2:0:0:3:0]/. Was http://[1:0:0:2::3:0]/.
PASS canonicalize('http://[1::2:0:0:3:0]/') is 'http://[1::2:0:0:3:0]/'
PASS canonicalize('http://[::eeee:192.168.0.1]/') is 'http://[::eeee:192.168.0.1]/'
PASS canonicalize('http://[2001::192.168.0.1]/') is 'http://[2001::192.168.0.1]/'
PASS canonicalize('http://[1:2:192.168.0.1:5:6]/') is 'http://[1:2:192.168.0.1:5:6]/'
FAIL canonicalize('http://[::ffff:192.1.2]/') should be http://[::ffff:c001:2]/. Was http://[::ffff:192.1.2]/.
FAIL canonicalize('http://[::ffff:0xC0.0Xa8.0x0.0x1]/') should be http://[::ffff:c0a8:1]/. Was http://[::ffff:0xC0.0Xa8.0x0.0x1]/.
FAIL canonicalize('http://[0:0::0:0:8]/') should be http://[::8]/. Was http://[0:0::0:0:8]/.
PASS canonicalize('http://[2001:db8::1]/') is 'http://[2001:db8::1]/'
PASS canonicalize('http://[2001::db8::1]/') is 'http://[2001::db8::1]/'
PASS canonicalize('http://[2001:db8:::1]/') is 'http://[2001:db8:::1]/'
PASS canonicalize('http://[:::]/') is 'http://[:::]/'
PASS canonicalize('http://[2001::.com]/') is 'http://[2001::.com]/'
PASS canonicalize('http://[::192.168.0.0.1]/') is 'http://[::192.168.0.0.1]/'
PASS canonicalize('http://[::ffff:192.168.0.0.1]/') is 'http://[::ffff:192.168.0.0.1]/'
PASS canonicalize('http://[1:2:3:4:5:6:7:8:9]/') is 'http://[1:2:3:4:5:6:7:8:9]/'
PASS canonicalize('http://[0:0:0:0:0:0:0:192.168.0.1]/') is 'http://[0:0:0:0:0:0:0:192.168.0.1]/'
PASS canonicalize('http://[1:2:3:4:5:6::192.168.0.1]/') is 'http://[1:2:3:4:5:6::192.168.0.1]/'
FAIL canonicalize('http://[1:2:3:4:5:6::8]/') should be http://[1:2:3:4:5:6:0:8]/. Was http://[1:2:3:4:5:6::8]/.
PASS canonicalize('http://[1:2:3:4:5:6:7:8:]/') is 'http://[1:2:3:4:5:6:7:8:]/'
PASS canonicalize('http://[1:2:3:4:5:6:192.168.0.1:]/') is 'http://[1:2:3:4:5:6:192.168.0.1:]/'
PASS canonicalize('http://[-1:2:3:4:5:6:7:8]/') is 'http://[-1:2:3:4:5:6:7:8]/'
FAIL canonicalize('http://[1::%1]/') should be http://[1::%251]/. Was http://[1::%1]/.
FAIL canonicalize('http://[1::%eth0]/') should be http://[1::%25eth0]/. Was http://[1::%eth0]/.
FAIL canonicalize('http://[1::%]/') should be http://[1::%25]/. Was http://[1::%]/.
FAIL canonicalize('http://[%]/') should be http://[%25]/. Was http://[%]/.
FAIL canonicalize('http://[::%:]/') should be http://[::%25:]/. Was http://[::%:]/.
PASS canonicalize('http://[:0:0::0:0:8]/') is 'http://[:0:0::0:0:8]/'
PASS canonicalize('http://[0:0::0:0:8:]/') is 'http://[0:0::0:0:8:]/'
PASS canonicalize('http://[:0:0::0:0:8:]/') is 'http://[:0:0::0:0:8:]/'
PASS canonicalize('http://[::192.168..1]/') is 'http://[::192.168..1]/'
FAIL canonicalize('http://[::1 hello]/') should be http://[::1%20hello]/. Was http://[::1 hello]/.
PASS successfullyParsed is true
TEST COMPLETE