summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-01-09 18:51:21 +0100
committerAndrew Kaster <andrewdkaster@gmail.com>2023-01-14 15:43:27 -0700
commit79b9dd6248b03c719d3c3a2f8bd0f48d12280610 (patch)
tree8df16d83fcc85e63d305d16c824d5eaba04718fa /Tests
parent822e32eb117b92609d5727c3226a441deaf71d7e (diff)
downloadserenity-79b9dd6248b03c719d3c3a2f8bd0f48d12280610.zip
AK+Tests: Make CaseInsensitiveStringViewTraits work with HashMap again
Diffstat (limited to 'Tests')
-rw-r--r--Tests/AK/TestHashMap.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/AK/TestHashMap.cpp b/Tests/AK/TestHashMap.cpp
index a6b5d2dea2..bbb4876c5d 100644
--- a/Tests/AK/TestHashMap.cpp
+++ b/Tests/AK/TestHashMap.cpp
@@ -108,6 +108,14 @@ TEST_CASE(case_insensitive)
EXPECT_EQ(casemap.size(), 1u);
}
+TEST_CASE(case_insensitive_stringview)
+{
+ HashMap<StringView, int, CaseInsensitiveStringViewTraits> casemap;
+ EXPECT_EQ(casemap.set("nickserv"sv, 3), AK::HashSetResult::InsertedNewEntry);
+ EXPECT_EQ(casemap.set("NickServ"sv, 3), AK::HashSetResult::ReplacedExistingEntry);
+ EXPECT_EQ(casemap.size(), 1u);
+}
+
TEST_CASE(hashmap_of_nonnullownptr_get)
{
struct Object {