sw/qa/extras/uiwriter/uiwriter3.cxx | 27 --------------------------- sw/qa/extras/uiwriter/uiwriter6.cxx | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 27 deletions(-)
New commits: commit 4813a93918023174a41a251e0e29f74df228c2d7 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Jul 4 13:54:05 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Jul 5 09:38:53 2022 +0200 sw_uiwriter: simplify autocorrect test In preparation for https://gerrit.libreoffice.org/c/core/+/136727 Also put this test with the rest of autocorrect tests Change-Id: I9aa632ff5751e603bf2a4f201b96b9a0369efc91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136799 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit de59dbdc488122f70229550dba21ba76e2c61146) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136763 diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 3c794a3da60e..db6b3b29fb97 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -1388,33 +1388,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) } } -CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139922) -{ - SwDoc* const pDoc = createSwDoc(); - SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); - - pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN); - Scheduler::ProcessEventsToIdle(); - - SwWrtShell* const pWrtSh = pDoc->GetDocShell()->GetWrtShell(); - CPPUNIT_ASSERT(pWrtSh); - - pWrtSh->Insert("this _is_ a SEntence. this _is_ a SEntence."); - - CPPUNIT_ASSERT_EQUAL(OUString("this _is_ a SEntence. this _is_ a SEntence."), - getParagraph(2)->getString()); - - //apply autocorrect StartAutoCorrect - dispatchCommand(mxComponent, ".uno:AutoFormatApply", {}); - Scheduler::ProcessEventsToIdle(); - - // Without the fix in place, this test would have failed with - // - Expected: This is a Sentence. This is a Sentence. - // - Actual : this is a Sentence. This is a Sentence. - CPPUNIT_ASSERT_EQUAL(OUString("This is a Sentence. This is a Sentence."), - getParagraph(2)->getString()); -} - CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261) { createSwDoc(DATA_DIRECTORY, "tdf125261.odt"); diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index b7187568cff4..e52e16abba71 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -1874,6 +1874,24 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf74363) CPPUNIT_ASSERT_EQUAL(OUString("Testing "), getParagraph(1)->getString()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf139922) +{ + createSwDoc(); + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN); + Scheduler::ProcessEventsToIdle(); + + emulateTyping(*pTextDoc, u"this is a SEntence. this is a SEntence."); + + // Without the fix in place, this test would have failed with + // - Expected: This is a Sentence. This is a Sentence. + // - Actual : this is a Sentence. This is a Sentence. + CPPUNIT_ASSERT_EQUAL(OUString("This is a Sentence. This is a Sentence."), + getParagraph(2)->getString()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf143176) { // Hungarian test document with right-to-left paragraph setting