diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-07-16 12:44:50 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-07-16 23:39:04 +0200 |
commit | 27e8099a740562bd46d716ccc65c8fb42424a557 (patch) | |
tree | 9664afab230329600d5d5f4366329ed718c903e4 /sw | |
parent | f8c89be7f1548902f8f6449222f87e00d845a303 (diff) |
tdf#42893: sw_autocorrect: Add unittest
Change-Id: I9a01eafea95e121f98153f43691bdb87fbb19e69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170573
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/autocorrect/autocorrect.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/autocorrect/autocorrect.cxx b/sw/qa/extras/autocorrect/autocorrect.cxx index be567006a523..ef238451aee0 100644 --- a/sw/qa/extras/autocorrect/autocorrect.cxx +++ b/sw/qa/extras/autocorrect/autocorrect.cxx @@ -280,6 +280,23 @@ CPPUNIT_TEST_FIXTURE(SwAutoCorrect, testTdf57640) CPPUNIT_ASSERT_EQUAL(u"Dž "_ustr, getParagraph(1)->getString()); } +CPPUNIT_TEST_FIXTURE(SwAutoCorrect, testTdf62923) +{ + createSwDoc(); // Default lang is en-US + SwXTextDocument& rTextDoc = dynamic_cast<SwXTextDocument&>(*mxComponent); + + OUString sReplaced(u"1–2 "_ustr); + // Without the fix in place, this test would have failed with + // - Expected: 1—2 + // - Actual : 1–2 + emulateTyping(rTextDoc, u"1--2 "); + CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); + + sReplaced += u"a—b "_ustr; + emulateTyping(rTextDoc, u"a--b "); + CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); +} + CPPUNIT_TEST_FIXTURE(SwAutoCorrect, testTdf42893) { createSwDoc(); // Default lang is en-US |