File indexing completed on 2024-04-14 03:40:42

0001 /*
0002     SPDX-FileCopyrightText: 2009 Anne-Marie Mahfouf <annma@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #include "malayalamtest.h"
0008 
0009 #include <QTest>
0010 #include <QString>
0011 
0012 void MalayalamTest::matchChar()
0013 {
0014     // Initial string that we want to separate into chars
0015     // You need to have Malayalam fonts installed
0016     QString string = QStringLiteral("യേ");
0017 
0018     //get first char and compare
0019     QCOMPARE(QString::fromUtf8("യ"), string.left(1));
0020     //get second char and compare    
0021     QCOMPARE(QString::fromUtf8("േ"), string.right(1));
0022 
0023 }
0024 
0025 void MalayalamTest::decomposeConsonant()
0026 {
0027     // Initial consonant that we want to separate into letters
0028     QString string = QStringLiteral("ഘൊ");
0029 
0030     QCOMPARE(string.length(), 3);
0031     //first letter
0032     QCOMPARE(QString::fromUtf8("ഘ"), string.mid(0,1));
0033     //second letter    
0034     QCOMPARE(QString::fromUtf8("െ"), string.mid(1,1));
0035     //third letter    
0036     QCOMPARE(QString::fromUtf8("ാ"), string.mid(2,1));
0037     
0038 }
0039 
0040 QTEST_MAIN(MalayalamTest)
0041 
0042 #include "moc_malayalamtest.cpp"