diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-09-05 14:52:35 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-09-06 15:24:27 +0100 |
commit | 1427ebc622b775885ff45d2f2b684534c2b3350a (patch) | |
tree | 389b8d1323cc7267f3b145315cc7dbc9d0567f0a /Tests/LibUnicode | |
parent | 0053d48c41c6d1699c7580a964f4b6d51f3f7bdb (diff) | |
download | serenity-1427ebc622b775885ff45d2f2b684534c2b3350a.zip |
LibUnicode: Implement locale-aware AFTER_SOFT_DOTTED special casing
Diffstat (limited to 'Tests/LibUnicode')
-rw-r--r-- | Tests/LibUnicode/TestUnicodeCharacterTypes.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/LibUnicode/TestUnicodeCharacterTypes.cpp b/Tests/LibUnicode/TestUnicodeCharacterTypes.cpp index eff0b89286..18cff2bdcb 100644 --- a/Tests/LibUnicode/TestUnicodeCharacterTypes.cpp +++ b/Tests/LibUnicode/TestUnicodeCharacterTypes.cpp @@ -257,6 +257,37 @@ TEST_CASE(to_unicode_uppercase_unconditional_special_casing) EXPECT_EQ(result, "\u03A9\u0342\u0399"); } +TEST_CASE(to_unicode_uppercase_special_casing_soft_dotted) +{ + // LATIN SMALL LETTER I + auto result = Unicode::to_unicode_uppercase_full("i"sv, "en"sv); + EXPECT_EQ(result, "I"sv); + + result = Unicode::to_unicode_uppercase_full("i"sv, "lt"sv); + EXPECT_EQ(result, "I"sv); + + // LATIN SMALL LETTER J + result = Unicode::to_unicode_uppercase_full("j"sv, "en"sv); + EXPECT_EQ(result, "J"sv); + + result = Unicode::to_unicode_uppercase_full("j"sv, "lt"sv); + EXPECT_EQ(result, "J"sv); + + // LATIN SMALL LETTER I followed by COMBINING DOT ABOVE + result = Unicode::to_unicode_uppercase_full("i\u0307"sv, "en"sv); + EXPECT_EQ(result, "I\u0307"sv); + + result = Unicode::to_unicode_uppercase_full("i\u0307"sv, "lt"sv); + EXPECT_EQ(result, "I"sv); + + // LATIN SMALL LETTER J followed by COMBINING DOT ABOVE + result = Unicode::to_unicode_uppercase_full("j\u0307"sv, "en"sv); + EXPECT_EQ(result, "J\u0307"sv); + + result = Unicode::to_unicode_uppercase_full("j\u0307"sv, "lt"sv); + EXPECT_EQ(result, "J"sv); +} + TEST_CASE(general_category) { auto general_category = [](StringView name) { |