starmath/qa/extras/data/color.mml | 20 ++++++++++++++++++++ starmath/qa/extras/mmlimport-test.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+)
New commits: commit f7834582a7f8ce53175f60b3ca3e62475a78f277 Author: Takeshi Abe <t...@fixedpoint.jp> Date: Tue Dec 6 18:14:17 2016 +0900 starmath: Add unit test for importing MathML's mathcolor Change-Id: I1e6378834889d6808a1aa724b2cc72c59b02435e Reviewed-on: https://gerrit.libreoffice.org/31671 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Takeshi Abe <t...@fixedpoint.jp> diff --git a/starmath/qa/extras/data/color.mml b/starmath/qa/extras/data/color.mml new file mode 100644 index 0000000..6aad87b --- /dev/null +++ b/starmath/qa/extras/data/color.mml @@ -0,0 +1,20 @@ +<math xmlns="http://www.w3.org/1998/Math/MathML"> + <mrow> + <mi mathcolor="black">b</mi> + <mi mathcolor="white">w</mi> + <mi mathcolor="red">r</mi> + <mi mathcolor="green">g</mi> + <mi mathcolor="blue">b</mi> + <mi mathcolor="yellow">y</mi> + <mi mathcolor="silver">s</mi> + <mi mathcolor="gray">g</mi> + <mi mathcolor="maroon">m</mi> + <mi mathcolor="purple">p</mi> + <mi mathcolor="lime">l</mi> + <mi mathcolor="olive">o</mi> + <mi mathcolor="navy">n</mi> + <mi mathcolor="teal">t</mi> + <mi mathcolor="aqua">a</mi> + <mi mathcolor="fuchsia">f</mi> + </mrow> +</math> diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index 01ae2ff..aa9e0f7 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -29,6 +29,7 @@ public: virtual void setUp() override; virtual void tearDown() override; + void testColor(); void testSimple(); void testNsPrefixMath(); void testMaction(); @@ -38,6 +39,7 @@ public: void testTdf103500(); CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(testColor); CPPUNIT_TEST(testSimple); CPPUNIT_TEST(testNsPrefixMath); CPPUNIT_TEST(testMaction); @@ -90,6 +92,28 @@ void Test::tearDown() BootstrapFixture::tearDown(); } +void Test::testColor() +{ + loadURL(m_directories.getURLFromSrc("starmath/qa/extras/data/color.mml")); + CPPUNIT_ASSERT_EQUAL(OUString("{{color black b}" + " {color white w}" + " {color red r}" + " {color green g}" + " {color blue b}" + " {color yellow y}" + " {color silver s}" + " {color gray g}" + " {color maroon m}" + " {color purple p}" + " {color lime l}" + " {color olive o}" + " {color navy n}" + " {color teal t}" + " {color aqua a}" + " {color fuchsia f}}"), + mxDocShell->GetText()); +} + void Test::testSimple() { loadURL(m_directories.getURLFromSrc("starmath/qa/extras/data/simple.mml")); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits