/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// Normally, a kashida would not be inserted after a final Yeh.
CPPUNIT_ASSERT_EQUAL(sal_Int32(4), GetWordKashidaPosition(u"نیمِـي"_ustr).value().nIndex);
}
// tdf#65344: Do not insert kashida before a final Yeh void KashidaTest::testFinalYeh()
{
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), GetWordKashidaPosition(u"يييي"_ustr).value().nIndex);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), GetWordKashidaPosition(u"ييي"_ustr).value().nIndex);
CPPUNIT_ASSERT(!GetWordKashidaPosition(u"يي"_ustr).has_value());
// Should always insert kashida after Seen, even before a final Yeh
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), GetWordKashidaPosition(u"كرسي"_ustr).value().nIndex);
}
// #i98410#: Do not insert kashida under a ZWNJ void KashidaTest::testNoZwnjExpansion()
{
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), GetWordKashidaPosition(u"نویسه"_ustr).value().nIndex);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), GetWordKashidaPosition(u"نویس\u200Cه"_ustr).value().nIndex);
// tdf#163105: Do not insert kashida if the position is invalid void KashidaTest::testExcludeInvalid()
{
std::vector<bool> aValid;
aValid.resize(5, true);
// Calls after this use the last resort (positions in aValid from end to start)
aValid[0] = false;
CPPUNIT_ASSERT_EQUAL(sal_Int32(2),
GetWordKashidaPosition(u"نویسه"_ustr, aValid).value().nIndex);
// - Start from end and work toward midpoint, then reverse direction
CPPUNIT_ASSERT_EQUAL(sal_Int32(5),
GetWordKashidaPosition(u"ܥܥܥܥܥܥܥ"_ustr, aValid).value().nIndex);
aValid[5] = false;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.