mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibURL: Replace Host's Empty state with making Url's Host optional
A couple of reasons: - Origin's Host (when in the tuple state) can't be null - There's an "empty host" concept in the spec which is NOT the same as a null Host, and that was confusing me.
This commit is contained in:
parent
8b984c0c57
commit
90e763de4c
Notes:
github-actions[bot]
2024-11-30 11:24:09 +00:00
Author: https://github.com/AtkinsSJ
Commit: 90e763de4c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2610
Reviewed-by: https://github.com/shannonbooth ✅
17 changed files with 44 additions and 42 deletions
|
@ -206,7 +206,7 @@ TEST_CASE(about_url)
|
|||
URL::URL url("about:blank"sv);
|
||||
EXPECT(url.is_valid());
|
||||
EXPECT_EQ(url.scheme(), "about");
|
||||
EXPECT(url.host().has<Empty>());
|
||||
EXPECT(!url.host().has_value());
|
||||
EXPECT_EQ(url.serialize_path(), "blank");
|
||||
EXPECT(!url.query().has_value());
|
||||
EXPECT(!url.fragment().has_value());
|
||||
|
@ -218,7 +218,7 @@ TEST_CASE(mailto_url)
|
|||
URL::URL url("mailto:mail@example.com"sv);
|
||||
EXPECT(url.is_valid());
|
||||
EXPECT_EQ(url.scheme(), "mailto");
|
||||
EXPECT(url.host().has<Empty>());
|
||||
EXPECT(!url.host().has_value());
|
||||
EXPECT_EQ(url.port_or_default(), 0);
|
||||
EXPECT_EQ(url.path_segment_count(), 1u);
|
||||
EXPECT_EQ(url.path_segment_at_index(0), "mail@example.com");
|
||||
|
@ -232,7 +232,7 @@ TEST_CASE(mailto_url_with_subject)
|
|||
URL::URL url("mailto:mail@example.com?subject=test"sv);
|
||||
EXPECT(url.is_valid());
|
||||
EXPECT_EQ(url.scheme(), "mailto");
|
||||
EXPECT(url.host().has<Empty>());
|
||||
EXPECT(!url.host().has_value());
|
||||
EXPECT_EQ(url.port_or_default(), 0);
|
||||
EXPECT_EQ(url.path_segment_count(), 1u);
|
||||
EXPECT_EQ(url.path_segment_at_index(0), "mail@example.com");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue