mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
None of the existing tests contain a URL which has a fragment in them, but this does verify that the URL parser does not actually find any! Also, this should let us verify the correctness of URLs which actually do contain fragments.
29 lines
928 B
HTML
29 lines
928 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
function printURL(input) {
|
|
println(input);
|
|
const url = new URL(input);
|
|
println(`protocol => '${url.protocol}'`);
|
|
println(`username => '${url.username}'`);
|
|
println(`password => '${url.password}'`);
|
|
println(`host => '${url.host}'`);
|
|
println(`hostname => '${url.hostname}'`);
|
|
println(`port => '${url.port}'`);
|
|
println(`pathname => '${url.pathname}'`);
|
|
println(`search => '${url.search}'`);
|
|
println(`hash => '${url.hash}'`);
|
|
}
|
|
|
|
for (url of [
|
|
'ftp://serenityos.org:21',
|
|
'http://[0:1:0:1:0:1:0:1]',
|
|
'http://[1:0:1:0:1:0:1:0]',
|
|
'http://[1:1:0:0:1:0:0:0]/',
|
|
'unknown://serenityos.org:0',
|
|
]) {
|
|
printURL(url);
|
|
}
|
|
});
|
|
</script>
|