diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2023-01-09 18:51:21 +0100 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2023-01-14 15:43:27 -0700 |
commit | 79b9dd6248b03c719d3c3a2f8bd0f48d12280610 (patch) | |
tree | 8df16d83fcc85e63d305d16c824d5eaba04718fa /Tests | |
parent | 822e32eb117b92609d5727c3226a441deaf71d7e (diff) | |
download | serenity-79b9dd6248b03c719d3c3a2f8bd0f48d12280610.zip |
AK+Tests: Make CaseInsensitiveStringViewTraits work with HashMap again
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/AK/TestHashMap.cpp | 8 |
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 { |