summaryrefslogtreecommitdiff
path: root/Tests/AK
diff options
context:
space:
mode:
authorThiago Henrique Hupner <thihup@gmail.com>2022-12-27 16:17:30 -0300
committerAndrew Kaster <andrewdkaster@gmail.com>2023-01-06 13:59:17 -0700
commit401bc137762f36b352c0c588bb64a8a770875fe2 (patch)
tree346f6448c2578a34ae0bbea98a1bf210c1a83ae4 /Tests/AK
parent96d3d3b0fe9b2d76cfc16f09ae28ef7a29247707 (diff)
downloadserenity-401bc137762f36b352c0c588bb64a8a770875fe2.zip
AK: Use base URL when the specified URL is empty
Diffstat (limited to 'Tests/AK')
-rw-r--r--Tests/AK/TestURL.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/AK/TestURL.cpp b/Tests/AK/TestURL.cpp
index 1042ac3755..8df7c7212d 100644
--- a/Tests/AK/TestURL.cpp
+++ b/Tests/AK/TestURL.cpp
@@ -9,6 +9,7 @@
#include <AK/Base64.h>
#include <AK/URL.h>
+#include <AK/URLParser.h>
TEST_CASE(construct)
{
@@ -406,3 +407,11 @@ TEST_CASE(complete_file_url_with_base)
EXPECT(sub_url.is_valid());
EXPECT_EQ(sub_url.path(), "/home/js/app.js");
}
+
+TEST_CASE(empty_url_with_base_url)
+{
+ URL base_url { "https://foo.com/"sv };
+ URL parsed_url = URLParser::parse(""sv, &base_url);
+ EXPECT_EQ(parsed_url.is_valid(), true);
+ EXPECT(base_url.equals(parsed_url));
+}