From 4eab37f3916b8aa1bd1526fd699fa27390de33e5 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 14 Aug 2023 16:11:13 +1200 Subject: [PATCH] LibWeb/Tests: Also include URL hash in test results 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. --- Tests/LibWeb/Text/expected/URL/url.txt | 5 +++++ Tests/LibWeb/Text/input/URL/url.html | 1 + 2 files changed, 6 insertions(+) diff --git a/Tests/LibWeb/Text/expected/URL/url.txt b/Tests/LibWeb/Text/expected/URL/url.txt index dcb44a8f2e..05ea1e7f99 100644 --- a/Tests/LibWeb/Text/expected/URL/url.txt +++ b/Tests/LibWeb/Text/expected/URL/url.txt @@ -7,6 +7,7 @@ hostname => 'serenityos.org' port => '' pathname => '/' search => '' +hash => '' http://[0:1:0:1:0:1:0:1] protocol => 'http:' username => '' @@ -16,6 +17,7 @@ hostname => '[0:1:0:1:0:1:0:1]' port => '' pathname => '/' search => '' +hash => '' http://[1:0:1:0:1:0:1:0] protocol => 'http:' username => '' @@ -25,6 +27,7 @@ hostname => '[1:0:1:0:1:0:1:0]' port => '' pathname => '/' search => '' +hash => '' http://[1:1:0:0:1:0:0:0]/ protocol => 'http:' username => '' @@ -34,6 +37,7 @@ hostname => '[1:1:0:0:1::]' port => '' pathname => '/' search => '' +hash => '' unknown://serenityos.org:0 protocol => 'unknown:' username => '' @@ -43,3 +47,4 @@ hostname => 'serenityos.org' port => '0' pathname => '' search => '' +hash => '' diff --git a/Tests/LibWeb/Text/input/URL/url.html b/Tests/LibWeb/Text/input/URL/url.html index 1f17dc7738..2131563357 100644 --- a/Tests/LibWeb/Text/input/URL/url.html +++ b/Tests/LibWeb/Text/input/URL/url.html @@ -12,6 +12,7 @@ println(`port => '${url.port}'`); println(`pathname => '${url.pathname}'`); println(`search => '${url.search}'`); + println(`hash => '${url.hash}'`); } for (url of [