From 9aca5ac2290718fd87204968d7e2d0e1b51fb791 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Thu, 26 Mar 2015 10:02:02 +0900 Subject: starmath: add test for detecting MathML's namespace prefix 'math:' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib1b3ec5fc25a05da4970c49a18647299d3d8ce01 Reviewed-on: https://gerrit.libreoffice.org/15013 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- starmath/qa/extras/data/ns-prefix-math.mml | 13 +++++++++++++ starmath/qa/extras/mmlimport-test.cxx | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 starmath/qa/extras/data/ns-prefix-math.mml (limited to 'starmath/qa/extras') 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 @@ + + + + + + a + + + b + + + 2 + + 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() -- cgit