diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-05-06 18:44:08 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-05-06 23:48:59 +0200 |
commit | be29bd29864e450b0a99898d560ba71562cf06da (patch) | |
tree | 12ac584df6ccb264d09749dcb75185b8c6a925c8 /sc | |
parent | df283b12a95d80a82aa2c2c9b8d32888a4d4039e (diff) |
tdf#131536: sc: Add unittest
Change-Id: I6ef8ef3f469b744a8be9d92c65201d75f8711831
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93582
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xlsx/tdf131536.xlsx | bin | 0 -> 24862 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf131536.xlsx b/sc/qa/unit/data/xlsx/tdf131536.xlsx Binary files differnew file mode 100644 index 000000000000..c2ce9eb11649 --- /dev/null +++ b/sc/qa/unit/data/xlsx/tdf131536.xlsx diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 7d8799d83a1c..fe786fb99b0d 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -243,6 +243,7 @@ public: void testMergedCellsXLSXML(); void testBackgroundColorStandardXLSXML(); + void testTdf131536(); void testNamedExpressionsXLSXML(); void testEmptyRowsXLSXML(); void testBorderDirectionsXLSXML(); @@ -388,6 +389,7 @@ public: #endif CPPUNIT_TEST(testMergedCellsXLSXML); CPPUNIT_TEST(testBackgroundColorStandardXLSXML); + CPPUNIT_TEST(testTdf131536); CPPUNIT_TEST(testNamedExpressionsXLSXML); CPPUNIT_TEST(testEmptyRowsXLSXML); CPPUNIT_TEST(testBorderDirectionsXLSXML); @@ -3828,6 +3830,23 @@ void ScFiltersTest::testBackgroundColorStandardXLSXML() xDocSh->DoClose(); } +void ScFiltersTest::testTdf131536() +{ + ScDocShellRef xDocSh = loadDoc("tdf131536.", FORMAT_XLSX); + CPPUNIT_ASSERT_MESSAGE("Failed to load named-exp-global.xml", xDocSh.is()); + ScDocument& rDoc = xDocSh->GetDocument(); + + ScAddress aPos(3,9,0); + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(aPos)); + ASSERT_FORMULA_EQUAL(rDoc, aPos, "IF(D$4=\"-\",\"-\",MID(TEXT(INDEX($Comparison.$I:$J,$Comparison.$A5,$Comparison.D$2),\"\"),2,4)" + "=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"\"),4))", nullptr); + + ScAddress aPos2(4,9,0); + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(aPos2)); + ASSERT_FORMULA_EQUAL(rDoc, aPos2, "IF(D$4=\"-\",\"-\",MID(TEXT(INDEX($Comparison.$I:$J,$Comparison.$A5,$Comparison.D$2),\"0\"),2,4)" + "=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"0\"),4))", nullptr); +} + void ScFiltersTest::testNamedExpressionsXLSXML() { { |