summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-03-10 11:59:07 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-10 14:09:48 +0100
commit84590ee3a9b681408d174449bf0cd3f9bd92e4e6 (patch)
treef462fe334c8ef29d5629d2b50bf974049552553d /starmath
parent9b52e7ab543406783a1535d03856a8b13b554a70 (diff)
tdf#137008: starmath_import: Add unittest
Change-Id: I4daadf45124331a2fb3b2ba28858c2cfe7c6950e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131312 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/qa/extras/data/tdf137008.mml1
-rw-r--r--starmath/qa/extras/mmlimport-test.cxx8
2 files changed, 9 insertions, 0 deletions
diff --git a/starmath/qa/extras/data/tdf137008.mml b/starmath/qa/extras/data/tdf137008.mml
new file mode 100644
index 000000000000..bc6ee25db3e6
--- /dev/null
+++ b/starmath/qa/extras/data/tdf137008.mml
@@ -0,0 +1 @@
+<math xmlns='http://www.w3.org/1998/Math/MathML'><mtable><mtr><mtd></mtd></mtr><mtr></mtr></mtable></math> \ No newline at end of file
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index d953e518430c..323b0e0fb2d4 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -39,6 +39,7 @@ public:
void testtdf99556();
void testTdf103430();
void testTdf103500();
+ void testTdf137008();
void testMathmlEntities();
CPPUNIT_TEST_SUITE(Test);
@@ -50,6 +51,7 @@ public:
CPPUNIT_TEST(testtdf99556);
CPPUNIT_TEST(testTdf103430);
CPPUNIT_TEST(testTdf103500);
+ CPPUNIT_TEST(testTdf137008);
CPPUNIT_TEST(testMathmlEntities);
CPPUNIT_TEST_SUITE_END();
@@ -169,6 +171,12 @@ void Test::testTdf103500()
mxDocShell->GetText());
}
+void Test::testTdf137008()
+{
+ // Without the fix in place, this test would have crashed
+ loadURL(m_directories.getURLFromSrc(u"starmath/qa/extras/data/tdf137008.mml"));
+ CPPUNIT_ASSERT_EQUAL(OUString("matrix{ { } # ## # }"), mxDocShell->GetText());
+}
void Test::testMathmlEntities()
{
loadURL(m_directories.getURLFromSrc(u"starmath/qa/extras/data/mthmlentities.mml"));