about summary refs log tree commit diff stats
path: root/test/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-25 00:54:08 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-25 01:00:02 +0200
commit83880e50e9baad96ad124790b204da21aae15fa2 (patch)
tree6229d16c42a5e8a31a36bb4a49157acd124992ae /test/js
parent5a16c29c8d68e8907a1ecc93ba1cf810efaefe1e (diff)
downloadchawan-83880e50e9baad96ad124790b204da21aae15fa2.tar.gz
url: fix a small incompatibility
+ some more cleanup
Diffstat (limited to 'test/js')
-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>