mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:17:35 +00:00
AK: Add URLParser relative file URL test
I was debugging a different issue in Ladybird, and noticed that completing relative file URLs with URL::complete_url didn't seem to work right. This test case covers both the working https case, as well as the file URL case fixed by the previous commit.
This commit is contained in:
parent
838d586b25
commit
5e5493e334
1 changed files with 6 additions and 0 deletions
|
@ -184,6 +184,12 @@ TEST_CASE(file_url_serialization)
|
|||
EXPECT_EQ(URL("file:///my/file#fragment"sv).serialize(), "file:///my/file#fragment");
|
||||
}
|
||||
|
||||
TEST_CASE(file_url_relative)
|
||||
{
|
||||
EXPECT_EQ(URL("https://vkoskiv.com/index.html"sv).complete_url("/static/foo.js"sv).serialize(), "https://vkoskiv.com/static/foo.js");
|
||||
EXPECT_EQ(URL("file:///home/vkoskiv/test/index.html"sv).complete_url("/static/foo.js"sv).serialize(), "file:///home/vkoskiv/test/static/foo.js");
|
||||
}
|
||||
|
||||
TEST_CASE(about_url)
|
||||
{
|
||||
URL url("about:blank"sv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue