AK: Allow comparing UTF-16 strings to UTF-8 strings

Before now, you could compare a Utf16View to a StringView, but it would
only be valid if the StringView were ASCII. When porting code to UTF-16,
it will be handy to have a code point-aware implementation for non-ASCII
StringViews.
This commit is contained in:
Timothy Flynn 2025-08-02 19:12:16 -04:00 committed by Tim Flynn
commit 0bf565b97f
Notes: github-actions[bot] 2025-08-05 11:08:55 +00:00
3 changed files with 35 additions and 2 deletions

View file

@ -1070,7 +1070,7 @@ TEST_CASE(equals_ascii)
test("ababababab"sv, "😀😀😀😀😀"_utf16);
// Non-ASCII string comparison.
EXPECT_NE("😀"sv, "😀"_utf16);
EXPECT_EQ("😀"sv, "😀"_utf16);
}
TEST_CASE(equals_ignoring_ascii_case)