summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-07-24 03:46:20 +0300
committerخالد حسني <khaled@libreoffice.org>2023-07-24 07:35:29 +0200
commitc728b15cbad331f8be545d6b4aad167c1244f3d0 (patch)
treee1df74e7c1d46959e33cefb6b1e5ea9a8c05a7ca /i18npool
parent9d6134508405a403612a3463bae3fadcceec9245 (diff)
i18npool: Add a test for sigma case folding
This is one of the special case folding characters. Change-Id: Icfe986b216eb62ed595402b31908c2fd22cd475e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154821 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/qa/cppunit/test_characterclassification.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_characterclassification.cxx b/i18npool/qa/cppunit/test_characterclassification.cxx
index 7a66b0db361b..dc8b361fc53c 100644
--- a/i18npool/qa/cppunit/test_characterclassification.cxx
+++ b/i18npool/qa/cppunit/test_characterclassification.cxx
@@ -81,6 +81,40 @@ CPPUNIT_TEST_FIXTURE(TestCharacterClassification, testStringType)
}
+CPPUNIT_TEST_FIXTURE(TestCharacterClassification, testSigma)
+{
+ {
+ // From upper case
+ OUString sTest(u"ὈΔΥΣΣΕΎΣ");
+ OUString sLowerCase = m_xCC->toLower(sTest, 0, sTest.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", OUString(u"ὀδυσσεύς"), sLowerCase);
+ OUString sUpperCase = m_xCC->toUpper(sLowerCase, 0, sLowerCase.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", sTest, sUpperCase);
+ }
+
+ {
+ // From lower case
+ OUString sTest(u"ὀδυσσεύς");
+ OUString sTitleCase = m_xCC->toTitle(sTest, 0, sTest.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be title", OUString(u"Ὀδυσσεύς"), sTitleCase);
+ OUString sUpperCase = m_xCC->toUpper(sTest, 0, sTest.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", OUString(u"ὈΔΥΣΣΕΎΣ"), sUpperCase);
+ OUString sLowerCase = m_xCC->toLower(sUpperCase, 0, sUpperCase.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", sTest, sLowerCase);
+ }
+
+ {
+ // From title case
+ OUString sTest(u"Ὀδυσσεύς");
+ OUString sTitleCase = m_xCC->toTitle(sTest, 0, sTest.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be title", OUString(u"Ὀδυσσεύς"), sTitleCase);
+ OUString sUpperCase = m_xCC->toUpper(sTest, 0, sTest.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", OUString(u"ὈΔΥΣΣΕΎΣ"), sUpperCase);
+ OUString sLowerCase = m_xCC->toLower(sTest, 0, sTest.getLength(), {});
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", OUString(u"ὀδυσσεύς"), sLowerCase);
+ }
+}
+
void TestCharacterClassification::setUp()
{
BootstrapFixtureBase::setUp();