diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2025-02-04 16:41:24 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2025-02-04 21:01:43 +0100 |
commit | 8fa6af450bf148f0033331e5b46154abd5ab72e5 (patch) | |
tree | 2459f51809e90f0963ef5a20880a5bb55672b331 /starmath/qa | |
parent | 1e7c73f612d99f320390cbca4d83b32cec1075dc (diff) |
tdf#127873, tdf#158867: starmath_export: Add unittest
Change-Id: I996f86cbf1bf64f08ec5e9f1b74805a74865880f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181126
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'starmath/qa')
-rw-r--r-- | starmath/qa/extras/mmlexport-test.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index c0b34afa3f76..55d7001a90a8 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -33,6 +33,7 @@ public: void testTdf101022(); void testMaj(); void testHadd(); + void testTdf158867(); CPPUNIT_TEST_SUITE(MathMLExportTest); CPPUNIT_TEST(testBlank); @@ -40,6 +41,7 @@ public: CPPUNIT_TEST(testTdf101022); CPPUNIT_TEST(testMaj); CPPUNIT_TEST(testHadd); + CPPUNIT_TEST(testTdf158867); CPPUNIT_TEST_SUITE_END(); protected: @@ -146,6 +148,21 @@ void MathMLExportTest::testHadd() assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi", u"\U0001EEF1"); } +void MathMLExportTest::testTdf158867() +{ + loadFromURL(u"private:factory/smath"_ustr); + SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); + SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); + pDocShell->SetText(u"1,2 over 2 = 0,65"_ustr); + save(u"MathML XML (Math)"_ustr); + xmlDocUniquePtr pDoc = parseXml(maTempFile); + CPPUNIT_ASSERT(pDoc); + assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mfrac/m:mn[1]", u"1,2"); + assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mfrac/m:mn[2]", u"2"); + assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mo", u"="); + assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mn", u"0,65"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(MathMLExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |