i18npool/qa/cppunit/test_breakiterator.cxx |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

New commits:
commit 8c063d4e293e76982d4310ddc162b565a9a3c16e
Author:     Jonathan Clark <jonat...@libreoffice.org>
AuthorDate: Mon Jul 15 13:44:14 2024 -0600
Commit:     Jonathan Clark <jonat...@libreoffice.org>
CommitDate: Tue Jul 16 04:43:26 2024 +0200

    tdf#114160 Regression tests for non-breaking ZWJ
    
    Per Unicode rules, ZWJ shouldn't be treated as a line break opportunity.
    This change adds regression tests to verify lines do not break at ZWJ.
    
    tdf#114160 was a regression introduced during a prior ICU upgrade. This
    was fixed by commit 44699b3de37f07090ac6fee1cd97aa76036e9700, but no
    tests were added for ZWJ at that time.
    
    Change-Id: Ieca919daea11dc161ae35fb6ffe5bd366cf4a6f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170534
    Tested-by: Jenkins
    Reviewed-by: Jonathan Clark <jonat...@libreoffice.org>

diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx 
b/i18npool/qa/cppunit/test_breakiterator.cxx
index baf1d47603c7..3b4ae3efea3d 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -477,6 +477,27 @@ void TestBreakIterator::testLineBreaking()
             CPPUNIT_ASSERT_EQUAL(sal_Int32{ 5 }, res.breakIndex);
         }
     }
+
+    // tdf#114160: ZWJ shouldn't be treated as a breaking character
+    {
+        aLocale.Language = "mn";
+        aLocale.Country = "MN";
+
+        {
+            auto res = 
m_xBreak->getLineBreak(u"\u1828\u1820\u200d\u00a0\u200d\u1873\u1873"_ustr, 6,
+                                              aLocale, 0, aHyphOptions, 
aUserOptions);
+            CPPUNIT_ASSERT_EQUAL(sal_Int32(0), res.breakIndex);
+        }
+
+        aLocale.Language = "en";
+        aLocale.Country = "US";
+
+        {
+            auto res = m_xBreak->getLineBreak(u"AB\u200d\u00a0\u200dCD"_ustr, 
6, aLocale, 0,
+                                              aHyphOptions, aUserOptions);
+            CPPUNIT_ASSERT_EQUAL(sal_Int32(0), res.breakIndex);
+        }
+    }
 }
 
 //See https://bugs.libreoffice.org/show_bug.cgi?id=49629

Reply via email to