diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-12-06 18:14:17 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-12-07 01:02:04 +0000 |
commit | f7834582a7f8ce53175f60b3ca3e62475a78f277 (patch) | |
tree | 5dafae00f57a73bfda2d265965e03ffb003f8818 /starmath/qa/extras | |
parent | 4b6c66daa8a4865bd7e3350c4a0307575d2aff63 (diff) |
starmath: Add unit test for importing MathML's mathcolor
Change-Id: I1e6378834889d6808a1aa724b2cc72c59b02435e
Reviewed-on: https://gerrit.libreoffice.org/31671
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/qa/extras')
-rw-r--r-- | starmath/qa/extras/data/color.mml | 20 | ||||
-rw-r--r-- | starmath/qa/extras/mmlimport-test.cxx | 24 |
2 files changed, 44 insertions, 0 deletions
diff --git a/starmath/qa/extras/data/color.mml b/starmath/qa/extras/data/color.mml new file mode 100644 index 000000000000..6aad87b21a7f --- /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 01ae2ffaaec7..aa9e0f7fe33b 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")); |