diff options
author | Eike Rathke <erack@redhat.com> | 2015-07-21 16:36:26 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-07-21 16:38:14 +0200 |
commit | bb7c3821208feef6cf713591a9805e4118dd7554 (patch) | |
tree | 9b4202e4ef5456a1761a8216a1261cae8a0691ab /sc | |
parent | 74cc3fbc17235f5c0010c363342a9a9adaf85c4e (diff) |
unit test for MATCH ReferenceOrForceArray parameter
Change-Id: I534480411d6c164f9f0955933b612c1a219402fd
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 0e562d733a52..8610c5467cb2 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); } |