about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/js/url.html14
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>
6 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135