diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-19 19:26:24 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-20 09:02:02 +0100 |
commit | 35a564864e6ce08abfa4924e1ea9314982e7957c (patch) | |
tree | 61847218b6eef35c42ae744c6d9969a05897c7a9 /sw/qa/extras | |
parent | eac9aa85802fcec2e2941b2c72f08ba0ff448bcf (diff) |
tdf#123285: sw_uiwriter3: Add unittest
Change-Id: I32c20543f648e42b603ae5b5ace5fbfd6463a9d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109654
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf123285.odt | bin | 0 -> 11762 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf123285.odt b/sw/qa/extras/uiwriter/data3/tdf123285.odt Binary files differnew file mode 100644 index 000000000000..1f92e1511a8b --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf123285.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 8250b01ef5dc..95503190218d 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -1082,6 +1082,31 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134021) CPPUNIT_ASSERT_EQUAL(12, getPages()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf123285) +{ + load(DATA_DIRECTORY, "tdf123285.odt"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(true, + getParagraph(1)->getString().endsWith( + ". Here is a short sentence demonstrating this very peculiar bug" + ". Here is a short sentence demonstrating this very peculiar bug.")); + + dispatchCommand(mxComponent, ".uno:GoToEndOfPage", {}); + Scheduler::ProcessEventsToIdle(); + + pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN); + Scheduler::ProcessEventsToIdle(); + + // Without the fix in place, the last "sentence" would have been changed to " entence" + CPPUNIT_ASSERT_EQUAL(true, + getParagraph(1)->getString().endsWith( + ". Here is a short sentence demonstrating this very peculiar bug" + ". Here is a short sentence demonstrating this very peculiar bug.")); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130746) { load(DATA_DIRECTORY, "tdf130746.odt"); |