tdf#149665: sc_ucalc: Add unittest
Change-Id: I0273e499ee607a54cbd32296e568ad46b1c0c0ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136839
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index d5c9831..8aa2fab 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -189,6 +189,7 @@ public:
void testSetBackgroundColor();
void testRenameTable();
void testTdf149665();
void testTdf64001();
void testAutoFill();
void testAutoFillSimple();
@@ -295,6 +296,7 @@ public:
CPPUNIT_TEST(testJumpToPrecedentsDependents);
CPPUNIT_TEST(testSetBackgroundColor);
CPPUNIT_TEST(testRenameTable);
CPPUNIT_TEST(testTdf149665);
CPPUNIT_TEST(testTdf64001);
CPPUNIT_TEST(testAutoFill);
CPPUNIT_TEST(testAutoFillSimple);
@@ -4469,6 +4471,20 @@ void Test::testJumpToPrecedentsDependents()
m_pDoc->DeleteTab(0);
}
void Test::testTdf149665()
{
m_pDoc->InsertTab(0, "Test");
m_pDoc->SetString(0, 0, 0, "''1");
// Without the fix in place, this test would have failed with
// - Expected: '1
// - Actual : ''1
CPPUNIT_ASSERT_EQUAL( OUString("'1"), m_pDoc->GetString( 0, 0, 0 ) );
m_pDoc->DeleteTab(0);
}
void Test::testTdf64001()
{
m_pDoc->InsertTab(0, "test");