mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +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
Notes:
sideshowbarker
2024-07-16 23:38:54 +09:00
Author: https://github.com/vkoskiv Commit: https://github.com/SerenityOS/serenity/commit/5e5493e334 Pull-request: https://github.com/SerenityOS/serenity/pull/19450
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…
Reference in a new issue