diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-03-26 10:02:02 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-26 14:07:21 +0000 |
commit | 9aca5ac2290718fd87204968d7e2d0e1b51fb791 (patch) | |
tree | 1eb1061a1e7de33c6feac76d9d0710041c0cf17e /starmath/qa/extras | |
parent | e86f4d3a8fad72123c51d1c272246cd0890ddecd (diff) |
starmath: add test for detecting MathML's namespace prefix 'math:'
Change-Id: Ib1b3ec5fc25a05da4970c49a18647299d3d8ce01
Reviewed-on: https://gerrit.libreoffice.org/15013
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath/qa/extras')
-rw-r--r-- | starmath/qa/extras/data/ns-prefix-math.mml | 13 | ||||
-rw-r--r-- | starmath/qa/extras/mmlimport-test.cxx | 11 |
2 files changed, 24 insertions, 0 deletions
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 000000000000..c4c961223b66 --- /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 3cfce68eb9aa..e52ebf308daa 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() |