[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 15 21:41:07 UTC 2021
sw/qa/extras/odfexport/data/tdf144319.odt |binary
sw/qa/extras/odfexport/odfexport.cxx | 17 +++++++++++++++++
2 files changed, 17 insertions(+)
New commits:
commit d5e55d204b71710eb5eb5d2c683dd6698626df3c
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Sep 15 19:59:53 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Sep 15 23:40:29 2021 +0200
tdf#144319: sw_odfexport: Add unittest
Change-Id: Ib3c6834150e7bc2538af413840b8b45b053af603
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122161
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/qa/extras/odfexport/data/tdf144319.odt b/sw/qa/extras/odfexport/data/tdf144319.odt
new file mode 100644
index 000000000000..937482c34f3a
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf144319.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index b8ba81ea9e91..905c3e949a19 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -132,6 +132,23 @@ DECLARE_ODFEXPORT_TEST(testMathObjectFlatExport, "2_MathType3.docx")
CPPUNIT_ASSERT_EQUAL(OUString(" size 12{2+2=4} {}"), formula2);
}
+DECLARE_ODFEXPORT_TEST(testTdf144319, "tdf144319.odt")
+{
+ OUString formula1(getFormula(getRun(getParagraph(3), 1)));
+ CPPUNIT_ASSERT_EQUAL(OUString("{ x = frac { { - b +- sqrt { b ^ 2 - 4 a c } } } { { 2 a } } }"), formula1);
+ OUString formula2(getFormula(getRun(getParagraph(4), 1)));
+ CPPUNIT_ASSERT_EQUAL(OUString("{ sum csup n csub { i = 1 } i ^ 3 = left ( frac { { n left ( { n + 1 } right ) } } { 2 } right ) ^ 2 }"), formula2);
+ OUString formula3(getFormula(getRun(getParagraph(5), 1)));
+ CPPUNIT_ASSERT_EQUAL(OUString("{ sum ^ n _ { i = 1 } i ^ 3 = left ( frac { { n left ( { n + 1 } right ) } } { 2 } right ) ^ 2 }"), formula3);
+ OUString formula4(getFormula(getRun(getParagraph(6), 1)));
+ CPPUNIT_ASSERT_EQUAL(OUString("{ sum ^ n _ { i = 1 } i ^ 3 = left ( frac { { n left ( { n + 1 } right ) } } { 2 } right ) ^ 2 }"), formula4);
+
+ // Without the fix in place, this test would have failed with
+ // - the property is of unexpected type or void: Model
+ OUString formula5(getFormula(getRun(getParagraph(7), 1)));
+ CPPUNIT_ASSERT_EQUAL(OUString("{ y ^ 2 { nitalic m p } = left ( { x ^ 3 + 7 } right ) { nitalic m p } }"), formula5);
+}
+
static void testTdf43569_CheckIfFieldParse()
{
{
More information about the Libreoffice-commits
mailing list