[Libreoffice-commits] core.git: starmath/qa
Takeshi Abe
tabe at fixedpoint.jp
Thu Mar 26 07:07:53 PDT 2015
starmath/qa/extras/data/ns-prefix-math.mml | 13 +++++++++++++
starmath/qa/extras/mmlimport-test.cxx | 11 +++++++++++
2 files changed, 24 insertions(+)
New commits:
commit 9aca5ac2290718fd87204968d7e2d0e1b51fb791
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Thu Mar 26 10:02:02 2015 +0900
starmath: add test for detecting MathML's namespace prefix 'math:'
Change-Id: Ib1b3ec5fc25a05da4970c49a18647299d3d8ce01
Reviewed-on: https://gerrit.libreoffice.org/15013
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/starmath/qa/extras/data/ns-prefix-math.mml b/starmath/qa/extras/data/ns-prefix-math.mml
new file mode 100644
index 0000000..c4c9612
--- /dev/null
+++ b/starmath/qa/extras/data/ns-prefix-math.mml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<math:math xmlns:math="http://www.w3.org/1998/Math/MathML">
+ <math:msup>
+ <math:mfenced>
+ <math:mrow>
+ <math:mi>a</math:mi>
+ <math:mo>+</math:mo>
+ <math:mi>b</math:mi>
+ </math:mrow>
+ </math:mfenced>
+ <math:mn>2</math:mn>
+ </math:msup>
+</math:math>
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index 3cfce68..e52ebf3 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -30,10 +30,12 @@ public:
virtual void tearDown() SAL_OVERRIDE;
void testSimple();
+ void testNsPrefixMath();
void testMaction();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testSimple);
+ CPPUNIT_TEST(testNsPrefixMath);
CPPUNIT_TEST(testMaction);
CPPUNIT_TEST_SUITE_END();
@@ -83,6 +85,15 @@ void Test::tearDown()
void Test::testSimple()
{
loadURL(getURLFromSrc("starmath/qa/extras/data/simple.mml"));
+ OUString sExpected("left ( {italic \"a\" + italic \"b\"} right )^italic \"2\"");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText());
+}
+
+void Test::testNsPrefixMath()
+{
+ loadURL(getURLFromSrc("starmath/qa/extras/data/ns-prefix-math.mml"));
+ OUString sExpected("left ( {italic \"a\" + italic \"b\"} right )^italic \"2\"");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", sExpected, mxDocShell->GetText());
}
void Test::testMaction()
More information about the Libreoffice-commits
mailing list