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

Eike Rathke erack at redhat.com
Tue Jul 21 07:39:15 PDT 2015


 sc/qa/unit/ucalc_formula.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit bb7c3821208feef6cf713591a9805e4118dd7554
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 21 16:36:26 2015 +0200

    unit test for MATCH ReferenceOrForceArray parameter
    
    Change-Id: I534480411d6c164f9f0955933b612c1a219402fd

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 0e562d7..8610c54 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -4263,6 +4263,25 @@ void Test::testFuncMATCH()
         CPPUNIT_ASSERT_EQUAL(OUString("6"), m_pDoc->GetString(ScAddress(1,0,0)));
     }
 
+    {
+        // Test the ReferenceOrForceArray parameter.
+
+        clearRange(m_pDoc, ScRange(0,0,0,1,7,0));
+
+        // B1:B5 contain numeric values.
+        m_pDoc->SetValue(ScAddress(1,0,0), 1.0);
+        m_pDoc->SetValue(ScAddress(1,1,0), 2.0);
+        m_pDoc->SetValue(ScAddress(1,2,0), 3.0);
+        m_pDoc->SetValue(ScAddress(1,3,0), 4.0);
+        m_pDoc->SetValue(ScAddress(1,4,0), 5.0);
+
+        // Find string value "33" in concatenated array, no implicit
+        // intersection is involved, array is forced.
+        m_pDoc->SetString(ScAddress(0,5,0), "=MATCH(\"33\";B1:B5&B1:B5)");
+        m_pDoc->CalcAll();
+        CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,5,0)));
+    }
+
     m_pDoc->DeleteTab(0);
 }
 


More information about the Libreoffice-commits mailing list