diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/js/url.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/js/url.html b/test/js/url.html index c168fb32..809718f7 100644 --- a/test/js/url.html +++ b/test/js/url.html @@ -41,6 +41,8 @@ assert_equals(new URL("abcd?efgh#ijkl", "https://example.com/") + "", "https://e const x = new URL("efgh:/test"); x.protocol = "abcd"; assert_equals(x.protocol, "abcd:"); + x.protocol = " efgh"; + assert_equals(x.protocol, "abcd:"); } { const x = new URL("http:/test"); @@ -49,5 +51,17 @@ assert_equals(new URL("abcd?efgh#ijkl", "https://example.com/") + "", "https://e x.protocol = "https"; assert_equals(x.protocol, "https:"); } +{ + const x = new URL("https://user:password@example.org:1234/path?search#hash"); + assert_equals(x.protocol, "https:"); + assert_equals(x.username, "user"); + assert_equals(x.password, "password"); + assert_equals(x.hostname, "example.org"); + assert_equals(x.port, "1234"); + assert_equals(x.host, "example.org:1234"); + assert_equals(x.pathname, "/path"); + assert_equals(x.search, "?search"); + assert_equals(x.hash, "#hash"); +} document.getElementById("x").textContent = "Success"; </script> |