From c4987cd730be2d4aa7c76e69fad4e3195413fb0c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 8 Feb 2014 18:01:08 -0500 Subject: fdo#74512: Add test for this. Change-Id: I472a91375c6408761d9c300b3575cfe101649fca --- sc/qa/unit/ucalc_formula.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 411ed9ee474b..05ff6b6bd87e 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -217,6 +217,26 @@ void Test::testFormulaParseReference() m_pDoc->GetName(4, aTabName); CPPUNIT_ASSERT_EQUAL(aTab4, aTabName); + // Make sure the formula input and output match. + { + const char* aChecks[] = { + "'90''s Music'.B12", + "'90''s and 70''s'.$AB$100", + "'All Others'.Z$100", + "NoQuote.$C111" + }; + + for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i) + { + // Use the 'Dummy' sheet for this. + OUString aInput("="); + aInput += OUString::createFromAscii(aChecks[i]); + m_pDoc->SetString(ScAddress(0,0,0), aInput); + if (!checkFormula(*m_pDoc, ScAddress(0,0,0), aChecks[i])) + CPPUNIT_FAIL("Wrong formula"); + } + } + ScAddress aPos; ScAddress::ExternalInfo aExtInfo; sal_uInt16 nRes = aPos.Parse("'90''s Music'.D10", m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo); -- cgit v1.2.3