summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-07-20 17:15:36 +0200
committerEike Rathke <erack@redhat.com>2016-07-20 17:16:43 +0200
commit35595869d19f052cb585c82a1a7e174debb944b0 (patch)
tree603a02e3520df0f33069c3a0215249bccd4bfcce
parente54cd3fbf40300416ef337981bd356b88ad44a41 (diff)
unit test for tdf#100637 nested IF in array context
Change-Id: I6f4e1ca61afeda4a2fbe249b3e0625280414afae
-rw-r--r--sc/qa/unit/ucalc_formula.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 25f42b8d8bd4..b2bfb37638cc 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -3926,6 +3926,14 @@ void Test::testFuncIF()
m_pDoc->SetValue(ScAddress(1,0,0), 3.0);
CPPUNIT_ASSERT_EQUAL(OUString("not two"), m_pDoc->GetString(ScAddress(0,0,0)));
+ // Test nested IF in array/matrix.
+ ScMarkData aMark;
+ aMark.SelectOneTable(0);
+ m_pDoc->InsertMatrixFormula(0,2, 1,2, aMark, "=IF({1;0};IF(1;23);42)");
+ // Results must be 23 and 42.
+ CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(42.0, m_pDoc->GetValue(ScAddress(1,2,0)));
+
m_pDoc->DeleteTab(0);
}