[Libreoffice-commits] core.git: sw/qa

shubham656 (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 13 09:11:18 UTC 2021


 sw/qa/extras/uiwriter/uiwriter.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit a72b6d2df5978c0f43e04432581f4bc62c2c6d8f
Author:     shubham656 <shubham656jain at gmail.com>
AuthorDate: Wed Jul 7 04:15:54 2021 +0530
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jul 13 11:10:46 2021 +0200

    tdf#78150 Add UnitTest
    
    Change-Id: I2ec92c229fcb6d38fd78c520a48d0bd3b739a82e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118542
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 533c752349ea..ea8e797b5737 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -283,6 +283,7 @@ public:
     void testTdf89954();
     void testTdf89720();
     void testTdf88986();
+    void testTdf78150();
     void testTdf87922();
     void testTdf77014();
     void testTdf92648();
@@ -403,6 +404,7 @@ public:
     CPPUNIT_TEST(testTdf89954);
     CPPUNIT_TEST(testTdf89720);
     CPPUNIT_TEST(testTdf88986);
+    CPPUNIT_TEST(testTdf78150);
     CPPUNIT_TEST(testTdf87922);
     CPPUNIT_TEST(testTdf77014);
     CPPUNIT_TEST(testTdf92648);
@@ -4292,6 +4294,23 @@ void SwUiWriterTest::testTdf88986()
     CPPUNIT_ASSERT(aSet.HasItem(SID_COLOR_TABLE));
 }
 
+void SwUiWriterTest::testTdf78150()
+{
+    SwDoc* pDoc = createSwDoc();
+    SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+    pWrtShell->Insert("foobar");
+
+    CPPUNIT_ASSERT_EQUAL(OUString("foobar"), getParagraph(1)->getString());
+
+    dispatchCommand(mxComponent, ".uno:DelToStartOfWord", {});
+
+    // Without the fix, test fails with:
+    // equality assertion failed
+    //  - Expected:
+    //  - Actual  : f
+    CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
+}
+
 void SwUiWriterTest::testTdf87922()
 {
     // Create an SwDrawTextInfo.


More information about the Libreoffice-commits mailing list