sw/qa/extras/uiwriter/uiwriter6.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+)
New commits: commit 66b30842e86fb6041bd6a453c6e3a877a3c177c1 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Feb 21 15:49:56 2024 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Feb 21 20:56:03 2024 +0100 tdf#159797: sw_uiwriter6: Add unittest Change-Id: I69b8ea673f676f1106e257cef507937cbd5ebd2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163695 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 88c8a354d98d..826cf40b4d58 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -3008,6 +3008,19 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf106663HeaderTextFrameGoToNextPlacem CPPUNIT_ASSERT(pCursor->GetPoint()->GetNode().GetTextNode()->GetText().startsWith("Heading")); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf159797) +{ + createSwDoc(); + SwXTextDocument& rTextDoc = dynamic_cast<SwXTextDocument&>(*mxComponent); + + emulateTyping(rTextDoc, u"This - is replaced. - But this is not replaced."); + // Without the fix in place, this would fail with + // - Expected: This – is replaced. – But this is not replaced. + // - Actual : This – is replaced. - But this is not replaced. + CPPUNIT_ASSERT_EQUAL(u"This – is replaced. – But this is not replaced."_ustr, + getParagraph(1)->getString()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407) { createSwDoc();
