Skip to content

Commit

Permalink
Update Unicode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Nov 15, 2024
1 parent e78fc64 commit ecc4bed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
44 changes: 16 additions & 28 deletions testsuite/tests/input/tex/Extpfeil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ describe('Extpfeil', () => {
tex2mml('\\xtwoheadrightarrow{abcxyz}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\xtwoheadrightarrow{abcxyz}" display="block">
<mover data-latex="\\xtwoheadrightarrow{abcxyz}">
<mstyle scriptlevel="0">
<mo data-mjx-texclass="REL">&#x21A0;</mo>
</mstyle>
<mo data-mjx-texclass="REL">&#x21A0;</mo>
<mpadded width="+1.556em" lspace="0.667em" voffset="-.2em" height="-.2em">
<mi data-latex="a">a</mi>
<mi data-latex="b">b</mi>
Expand All @@ -30,9 +28,7 @@ describe('Extpfeil', () => {
tex2mml('\\xtwoheadleftarrow{abcxyz}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\xtwoheadleftarrow{abcxyz}" display="block">
<mover data-latex="\\xtwoheadleftarrow{abcxyz}">
<mstyle scriptlevel="0">
<mo data-mjx-texclass="REL">&#x219E;</mo>
</mstyle>
<mo data-mjx-texclass="REL">&#x219E;</mo>
<mpadded width="+1.667em" lspace="0.944em" voffset="-.2em" height="-.2em">
<mi data-latex="a">a</mi>
<mi data-latex="b">b</mi>
Expand All @@ -50,9 +46,7 @@ describe('Extpfeil', () => {
tex2mml('\\xmapsto{abcxyz}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\xmapsto{abcxyz}" display="block">
<mover data-latex="\\xmapsto{abcxyz}">
<mstyle scriptlevel="0">
<mo data-mjx-texclass="REL">&#x21A6;</mo>
</mstyle>
<mo data-mjx-texclass="REL">&#x21A6;</mo>
<mpadded width="+0.722em" lspace="0.333em" voffset="-.2em" height="-.2em">
<mi data-latex="a">a</mi>
<mi data-latex="b">b</mi>
Expand All @@ -70,9 +64,7 @@ describe('Extpfeil', () => {
tex2mml('\\xlongequal{abcxyz}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\xlongequal{abcxyz}" display="block">
<mover data-latex="\\xlongequal{abcxyz}">
<mstyle scriptlevel="0">
<mo data-mjx-texclass="REL" stretchy="true">=</mo>
</mstyle>
<mo data-mjx-texclass="REL" stretchy="true">=</mo>
<mpadded width="+0.778em" lspace="0.389em" voffset="-.2em" height="-.2em">
<mi data-latex="a">a</mi>
<mi data-latex="b">b</mi>
Expand All @@ -90,9 +82,7 @@ describe('Extpfeil', () => {
tex2mml('\\xtofrom{abcxyz}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\xtofrom{abcxyz}" display="block">
<mover data-latex="\\xtofrom{abcxyz}">
<mstyle scriptlevel="0">
<mo data-mjx-texclass="REL">&#x21C4;</mo>
</mstyle>
<mo data-mjx-texclass="REL">&#x21C4;</mo>
<mpadded width="+1.333em" lspace="0.667em" voffset="-.2em" height="-.2em">
<mi data-latex="a">a</mi>
<mi data-latex="b">b</mi>
Expand All @@ -110,9 +100,7 @@ describe('Extpfeil', () => {
tex2mml('\\Newextarrow{\\ab}{10,20}{8672}\\ab{xyz}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\Newextarrow{\\ab}{10,20}{8672}\\ab{xyz}" display="block">
<mover data-latex="\\Newextarrow{\\ab}{10,20}{8672}\\ab{xyz}">
<mstyle scriptlevel="0">
<mo data-mjx-texclass="REL">&#x21E0;</mo>
</mstyle>
<mo data-mjx-texclass="REL">&#x21E0;</mo>
<mpadded width="+1.667em" lspace="0.556em" voffset="-.2em" height="-.2em">
<mi data-latex="x">x</mi>
<mi data-latex="y">y</mi>
Expand All @@ -128,44 +116,44 @@ describe('Extpfeil Errors', () => {
it('NewextarrowArg1', () =>
toXmlMatch(
tex2mml('\\Newextarrow{ab}{10,20}{8672}\\ab{xyz}'),
`<math xmlns=\"http://www.w3.org/1998/Math/MathML\" data-latex=\"\\Newextarrow{ab}{10,20}{8672}\\ab{xyz}\" display=\"block\">
<merror data-mjx-error=\"First argument to \\Newextarrow must be a control sequence name\">
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\Newextarrow{ab}{10,20}{8672}\\ab{xyz}" display="block">
<merror data-mjx-error="First argument to \\Newextarrow must be a control sequence name">
<mtext>First argument to \\Newextarrow must be a control sequence name</mtext>
</merror>
</math>`
));
it('NewextarrowArg2 One', () =>
toXmlMatch(
tex2mml('\\Newextarrow{\\ab}{10}{8672}\\ab{xyz}'),
`<math xmlns=\"http://www.w3.org/1998/Math/MathML\" data-latex=\"\\Newextarrow{\\ab}{10}{8672}\\ab{xyz}\" display=\"block\">
<merror data-mjx-error=\"Second argument to \\Newextarrow must be two integers separated by a comma\">
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\Newextarrow{\\ab}{10}{8672}\\ab{xyz}" display="block">
<merror data-mjx-error="Second argument to \\Newextarrow must be two integers separated by a comma">
<mtext>Second argument to \\Newextarrow must be two integers separated by a comma</mtext>
</merror>
</math>`
));
it('NewextarrowArg2 Two', () =>
toXmlMatch(
tex2mml('\\Newextarrow{\\ab}{10 20}{8672}\\ab{xyz}'),
`<math xmlns=\"http://www.w3.org/1998/Math/MathML\" data-latex=\"\\Newextarrow{\\ab}{10 20}{8672}\\ab{xyz}\" display=\"block\">
<merror data-mjx-error=\"Second argument to \\Newextarrow must be two integers separated by a comma\">
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\Newextarrow{\\ab}{10 20}{8672}\\ab{xyz}" display="block">
<merror data-mjx-error="Second argument to \\Newextarrow must be two integers separated by a comma">
<mtext>Second argument to \\Newextarrow must be two integers separated by a comma</mtext>
</merror>
</math>`
));
it('NewextarrowArg2 Three', () =>
toXmlMatch(
tex2mml('\\Newextarrow{\\ab}{aa}{8672}\\ab{xyz}'),
`<math xmlns=\"http://www.w3.org/1998/Math/MathML\" data-latex=\"\\Newextarrow{\\ab}{aa}{8672}\\ab{xyz}\" display=\"block\">
<merror data-mjx-error=\"Second argument to \\Newextarrow must be two integers separated by a comma\">
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\Newextarrow{\\ab}{aa}{8672}\\ab{xyz}" display="block">
<merror data-mjx-error="Second argument to \\Newextarrow must be two integers separated by a comma">
<mtext>Second argument to \\Newextarrow must be two integers separated by a comma</mtext>
</merror>
</math>`
));
it('NewextarrowArg3', () =>
toXmlMatch(
tex2mml('\\Newextarrow{\\ab}{10,20}{AG}\\ab{xyz}'),
`<math xmlns=\"http://www.w3.org/1998/Math/MathML\" data-latex=\"\\Newextarrow{\\ab}{10,20}{AG}\\ab{xyz}\" display=\"block\">
<merror data-mjx-error=\"Third argument to \\Newextarrow must be a unicode character number\">
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\Newextarrow{\\ab}{10,20}{AG}\\ab{xyz}" display="block">
<merror data-mjx-error="Third argument to \\Newextarrow must be a unicode character number">
<mtext>Third argument to \\Newextarrow must be a unicode character number</mtext>
</merror>
</math>`
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/input/tex/Unicode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Unicode', () => {
toXmlMatch(
tex2mml('\\mbox{A}\\unicode{65}{B}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\mbox{A}\\unicode{65}{B}" display="block">
<mstyle displaystyle="false" scriptlevel="0" data-latex="\\mbox{A}">
<mstyle displaystyle="false" data-latex="\\mbox{A}">
<mtext>A</mtext>
</mstyle>
<mtext data-latex="\\unicode{65}">A</mtext>
Expand Down

0 comments on commit ecc4bed

Please sign in to comment.