sc/qa/unit/uicalc/uicalc.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 400bfd03a97a9af75a55230bffd53fca45a0f3a6
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Mar 24 12:33:10 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Mar 24 17:17:04 2022 +0100

    tdf#113898: sc_uicalc: Add unittest
    
    Change-Id: I52fa7ad0cb1f9b3d2f72229d961674f6292be60f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132071
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 8871195f4609..90bafa91f64e 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -234,6 +234,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences)
     insertStringToCell(*pModelObj, "C2", "20");
     insertStringToCell(*pModelObj, "C3", "5");
 
+    insertStringToCell(*pModelObj, "D1", "BIG FISH");
+    insertStringToCell(*pModelObj, "D2", "FISHFISH");
+    insertStringToCell(*pModelObj, "D3", "FISHY");
+
     // Save the document
     utl::TempFile aTempFile = save(mxComponent, "calc8");
 
@@ -317,6 +321,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences)
         CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(0, 0, 
0)));
         CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(1, 0, 
0)));
     }
+
+    {
+        //tdf#113898
+        OUString aAndFormula = "=SUMPRODUCT(NOT(ISERROR(FIND(\"FISH\";'" + 
aTempFile.GetURL()
+                               + "'#$Sheet1.D1:D3))))";
+        insertStringToCell(*pModelObj, "A1", aAndFormula.toUtf8().getStr());
+
+        // Without the fix in place, this test would have failed with
+        // - Expected: 3
+        // - Actual  : 1
+        CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(0, 0, 0)));
+    }
 }
 
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf103994)

Reply via email to