diff options
author | Ćukasz Walukiewicz <lukasz@walukiewicz.eu> | 2012-01-26 03:12:00 +0400 |
---|---|---|
committer | koichik <koichik@improvement.jp> | 2012-01-31 11:58:41 +0400 |
commit | a94ffdaec57d9999485b11183f8da10aec15ff8d (patch) | |
tree | 2d80c7f7e87f19c7159a9d3b01a387bd91456cf9 /test | |
parent | 26bfb6bea45348d6aaa213b4ee38ac002c429394 (diff) |
url: Support for IPv6 addresses in URLs.
Fixes #1138, #2610.
Diffstat (limited to 'test')
-rw-r--r-- | test/simple/test-url.js | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/test/simple/test-url.js b/test/simple/test-url.js index 6a847b246da..fbbdbbbf478 100644 --- a/test/simple/test-url.js +++ b/test/simple/test-url.js @@ -476,6 +476,55 @@ var parseTests = { 'href': 'www.example.com', 'pathname': 'www.example.com', 'path': 'www.example.com' + }, + // ipv6 support + '[fe80::1]': { + 'href': '[fe80::1]', + 'pathname': '[fe80::1]', + 'path': '[fe80::1]' + }, + 'coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]': { + 'protocol': 'coap:', + 'slashes': true, + 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]', + 'hostname': 'fedc:ba98:7654:3210:fedc:ba98:7654:3210', + 'href': 'coap://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/', + 'pathname': '/', + 'path': '/' + }, + 'coap://[1080:0:0:0:8:800:200C:417A]:61616/': { + 'protocol': 'coap:', + 'slashes': true, + 'host': '[1080:0:0:0:8:800:200c:417a]:61616', + 'port': '61616', + 'hostname': '1080:0:0:0:8:800:200c:417a', + 'href': 'coap://[1080:0:0:0:8:800:200c:417a]:61616/', + 'pathname': '/', + 'path': '/' + }, + 'http://user:password@[3ffe:2a00:100:7031::1]:8080': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:password', + 'host': '[3ffe:2a00:100:7031::1]:8080', + 'port': '8080', + 'hostname': '3ffe:2a00:100:7031::1', + 'href': 'http://user:password@[3ffe:2a00:100:7031::1]:8080/', + 'pathname': '/', + 'path': '/' + }, + 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature': { + 'protocol': 'coap:', + 'slashes': true, + 'auth': 'u:p', + 'host': '[::192.9.5.5]:61616', + 'port': '61616', + 'hostname': '::192.9.5.5', + 'href': 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature', + 'search': '?n=Temperature', + 'query': 'n=Temperature', + 'pathname': '/.well-known/r', + 'path': '/.well-known/r?n=Temperature' } }; @@ -650,6 +699,22 @@ var formatTests = { 'hostname': 'foo', 'protocol': 'dot.test:', 'pathname': '/bar' + }, + // ipv6 support + 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature': { + 'href': 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature', + 'protocol': 'coap:', + 'auth': 'u:p', + 'hostname': '::1', + 'port': '61616', + 'pathname': '/.well-known/r', + 'search': 'n=Temperature' + }, + 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton': { + 'href': 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton', + 'protocol': 'coap', + 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616', + 'pathname': '/s/stopButton' } }; for (var u in formatTests) { |