diff --git a/bindings/js/tests/index.ts b/bindings/js/tests/index.ts index b7d51e2c..c474c090 100644 --- a/bindings/js/tests/index.ts +++ b/bindings/js/tests/index.ts @@ -8,4 +8,19 @@ test("Addition of Real Numbers", async () => { const addResult = Oasis.Simplify(add); const addResultStr = Oasis.ToMathMLString(addResult); assert.equal(addResultStr, "4\n"); +}); + +test("Parsing and Serializing of Integrals", async () => { + const Oasis = await loadOasis(); + const integral = Oasis.FromInFix("in ( 1 , x )"); + const integralML = Oasis.ToMathMLString(integral); + assert.equal(integralML, ` + + 1 + + d + x + + +`); }); \ No newline at end of file diff --git a/io/src/MathMLSerializer.cpp b/io/src/MathMLSerializer.cpp index 7ae1a710..ca3823b0 100644 --- a/io/src/MathMLSerializer.cpp +++ b/io/src/MathMLSerializer.cpp @@ -383,7 +383,7 @@ auto MathMLSerializer::TypedVisit(const Integral<>& integral) -> RetT // Integral symbol tinyxml2::XMLElement* inte = doc.NewElement("mo"); - inte->SetText("∫"); + inte->SetText(reinterpret_cast(u8"\u222B")); tinyxml2::XMLElement* dNode = doc.NewElement("mo"); dNode->SetText("d"); diff --git a/io/tests/MathMLTests.cpp b/io/tests/MathMLTests.cpp index 2b0e5ccc..526571be 100644 --- a/io/tests/MathMLTests.cpp +++ b/io/tests/MathMLTests.cpp @@ -2,6 +2,7 @@ #include "Oasis/Add.hpp" #include "Oasis/Divide.hpp" +#include "Oasis/Integral.hpp" #include "Oasis/Multiply.hpp" #include "Oasis/Matrix.hpp" #include "Oasis/Variable.hpp" @@ -238,14 +239,33 @@ TEST_CASE("Matrix to MathML 3x2", "[Matrix][MathML]") // std::cout<(u8R"( + + 1 + + d + x + + +)"); + + REQUIRE(expected == mathml); +} \ No newline at end of file