-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
342 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<x:description | ||
xmlns:docx2hub="http:https://transpect.io/docx2hub" | ||
xmlns:x="http:https://www.jenitennison.com/xslt/xspec" | ||
stylesheet="../xsl/main.xsl"> | ||
<x:param name="debug" select="'no'"/> | ||
<x:scenario label="Given pt-border-size"> | ||
<x:scenario label="of 0"> | ||
<x:call function="docx2hub:pt-border-size"> | ||
<x:param name="val" select="'0'"/> | ||
</x:call> | ||
<x:expect label="minimum 0.25pt is returned" select="'0.25pt'"/> | ||
</x:scenario> | ||
<x:scenario label="of 100"> | ||
<x:call function="docx2hub:pt-border-size"> | ||
<x:param name="val" select="'100'"/> | ||
</x:call> | ||
<x:expect label="maximum 12pt is returned" select="'12pt'"/> | ||
</x:scenario> | ||
<x:scenario label="of 12"> | ||
<x:call function="docx2hub:pt-border-size"> | ||
<x:param name="val" select="'12'"/> | ||
</x:call> | ||
<x:expect label="1.5pt is returned" select="'1.5pt'"/> | ||
</x:scenario> | ||
</x:scenario> | ||
</x:description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<x:description | ||
xmlns:x="http:https://www.jenitennison.com/xslt/xspec" | ||
xmlns:mml="http:https://www.w3.org/1998/Math/MathML" | ||
xmlns:w="http:https://schemas.openxmlformats.org/wordprocessingml/2006/main" | ||
xmlns:m="http:https://schemas.openxmlformats.org/officeDocument/2006/math" | ||
stylesheet="../xsl/omml2mml/omml2mml.xsl"> | ||
<x:scenario label="Given msPre"> | ||
<x:scenario label="with only containing text"> | ||
<x:context mode="omml2mml"> | ||
<m:sPre> | ||
<m:sub/> | ||
<m:sup> | ||
<m:r> | ||
<m:t>d</m:t> | ||
</m:r> | ||
</m:sup> | ||
<m:e> | ||
<m:r> | ||
<m:t>a</m:t> | ||
</m:r> | ||
</m:e> | ||
</m:sPre> | ||
</x:context> | ||
<x:expect label="mmultiscripts should be generated"> | ||
<mml:mmultiscripts> | ||
<mml:mrow> | ||
<mml:mi>a</mml:mi> | ||
</mml:mrow> | ||
<mml:mprescripts /> | ||
<mml:mrow /> | ||
<mml:mrow> | ||
<mml:mi>d</mml:mi> | ||
</mml:mrow> | ||
</mml:mmultiscripts> | ||
</x:expect> | ||
</x:scenario> | ||
<x:scenario label="with m:frac as base"> | ||
<x:context mode="omml2mml"> | ||
<m:sPre> | ||
<m:sub/> | ||
<m:sup> | ||
<m:r> | ||
<m:t>d</m:t> | ||
</m:r> | ||
</m:sup> | ||
<m:e> | ||
<m:f> | ||
<m:num> | ||
<m:r> | ||
<m:t xml:space="preserve">a</m:t> | ||
</m:r> | ||
</m:num> | ||
<m:den> | ||
<m:r> | ||
<m:t xml:space="preserve">b</m:t> | ||
</m:r> | ||
</m:den> | ||
</m:f> | ||
</m:e> | ||
</m:sPre> | ||
</x:context> | ||
<x:expect label="mmultiscripts should be generated"> | ||
<mml:mmultiscripts> | ||
<mml:mrow> | ||
<mml:mfrac> | ||
<mml:mrow> | ||
<mml:mi>a</mml:mi> | ||
</mml:mrow> | ||
<mml:mrow> | ||
<mml:mi>b</mml:mi> | ||
</mml:mrow> | ||
</mml:mfrac> | ||
</mml:mrow> | ||
<mml:mprescripts /> | ||
<mml:mrow /> | ||
<mml:mrow> | ||
<mml:mi>d</mml:mi> | ||
</mml:mrow> | ||
</mml:mmultiscripts> | ||
</x:expect> | ||
</x:scenario> | ||
<x:scenario label="text and m:frac as base"> | ||
<x:context mode="omml2mml"> | ||
<m:sPre> | ||
<m:sub/> | ||
<m:sup> | ||
<m:r> | ||
<m:t>d</m:t> | ||
</m:r> | ||
</m:sup> | ||
<m:e> | ||
<m:r> | ||
<m:t xml:space="preserve">a</m:t> | ||
</m:r> | ||
<m:f> | ||
<m:num> | ||
<m:r> | ||
<m:t xml:space="preserve">b</m:t> | ||
</m:r> | ||
</m:num> | ||
<m:den> | ||
<m:r> | ||
<m:t xml:space="preserve">c</m:t> | ||
</m:r> | ||
</m:den> | ||
</m:f> | ||
</m:e> | ||
</m:sPre> | ||
</x:context> | ||
<x:expect label="only text should be mmultiscripts base"> | ||
<mml:mrow> | ||
<mml:mmultiscripts> | ||
<mml:mrow> | ||
<mml:mi>a</mml:mi> | ||
</mml:mrow> | ||
<mml:mprescripts /> | ||
<mml:mrow /> | ||
<mml:mrow> | ||
<mml:mi>d</mml:mi> | ||
</mml:mrow> | ||
</mml:mmultiscripts> | ||
<mml:mfrac> | ||
<mml:mrow> | ||
<mml:mi>b</mml:mi> | ||
</mml:mrow> | ||
<mml:mrow> | ||
<mml:mi>c</mml:mi> | ||
</mml:mrow> | ||
</mml:mfrac> | ||
</mml:mrow> | ||
</x:expect> | ||
</x:scenario> | ||
</x:scenario> | ||
<x:scenario label="Given m:t with m:sty/@m:val='b'"> | ||
<x:scenario label="and a number"> | ||
<x:context mode="omml2mml"> | ||
<m:r> | ||
<m:rPr> | ||
<m:sty m:val="b"/> | ||
</m:rPr> | ||
<w:rPr> | ||
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/> | ||
</w:rPr> | ||
<m:t>0,8</m:t> | ||
</m:r> | ||
</x:context> | ||
<x:expect label="bold mml:mn is generated"> | ||
<mn xmlns="http:https://www.w3.org/1998/Math/MathML" mathvariant="bold">0,8</mn> | ||
</x:expect> | ||
</x:scenario> | ||
</x:scenario> | ||
<x:scenario label="Given m:aln and an operator"> | ||
<x:context mode="omml2mml"> | ||
<m:r> | ||
<m:rPr> | ||
<m:aln/> | ||
</m:rPr> | ||
<w:rPr> | ||
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/> | ||
</w:rPr> | ||
<m:t>=1-</m:t> | ||
</m:r> | ||
</x:context> | ||
<x:expect label="m:aligngroup is generated only on first operator in run"> | ||
<mml:maligngroup columnalign="left"/> | ||
<mml:mo>=</mml:mo> | ||
<mml:mn>1</mml:mn> | ||
<mml:mo>-</mml:mo> | ||
</x:expect> | ||
</x:scenario> | ||
</x:description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<x:description stylesheet="../xsl/main.xsl" | ||
xmlns:m="http:https://schemas.openxmlformats.org/officeDocument/2006/math" | ||
xmlns:mml="http:https://www.w3.org/1998/Math/MathML" | ||
xmlns:w="http:https://schemas.openxmlformats.org/wordprocessingml/2006/main" | ||
xmlns:x="http:https://www.jenitennison.com/xslt/xspec"> | ||
<x:param name="debug" select="'no'"/> | ||
<x:scenario label="Given m:oMathPara, containing m:aln in descendants"> | ||
<x:context mode="wml-to-dbk"> | ||
<w:document> | ||
<w:p> | ||
<tabs xmlns="http:https://docbook.org/ns/docbook"> | ||
<tab align="right" horizontal-position="305.8pt"/> | ||
</tabs> | ||
<m:oMathPara> | ||
<m:oMath> | ||
<m:r> | ||
<m:t>a</m:t> | ||
</m:r> | ||
<m:r> | ||
<m:rPr> | ||
<m:aln/> | ||
</m:rPr> | ||
<w:rPr> | ||
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/> | ||
</w:rPr> | ||
<m:t>=b</m:t> | ||
</m:r> | ||
<m:r> | ||
<m:rPr> | ||
<m:sty m:val="p"/> | ||
</m:rPr> | ||
<w:rPr> | ||
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/> | ||
</w:rPr> | ||
<w:br /> | ||
</m:r> | ||
</m:oMath> | ||
<m:oMath> | ||
<m:r> | ||
<m:rPr> | ||
<m:aln/> | ||
</m:rPr> | ||
<w:rPr> | ||
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/> | ||
</w:rPr> | ||
<m:t>=c</m:t> | ||
</m:r> | ||
</m:oMath> | ||
</m:oMathPara> | ||
</w:p> | ||
</w:document> | ||
</x:context> | ||
<x:expect label="mtable with maligngroup is generated"> | ||
<para xmlns="http:https://docbook.org/ns/docbook"> | ||
<tabs> | ||
<tab align="right" horizontal-position="305.8pt"/> | ||
</tabs> | ||
<equation role="omml"> | ||
<mml:math display="block"> | ||
<mml:mtable> | ||
<mml:mtr> | ||
<mml:mtd> | ||
<mml:mi>a</mml:mi> | ||
<mml:maligngroup /> | ||
<mml:mo>=</mml:mo> | ||
<mml:mi>b</mml:mi> | ||
<mml:mspace linebreak="newline" /> | ||
</mml:mtd> | ||
</mml:mtr> | ||
<mml:mtr> | ||
<mml:mtd> | ||
<mml:maligngroup /> | ||
<mml:mo>=</mml:mo> | ||
<mml:mi>c</mml:mi> | ||
</mml:mtd> | ||
</mml:mtr> | ||
</mml:mtable> | ||
</mml:math> | ||
</equation> | ||
</para> | ||
</x:expect> | ||
</x:scenario> | ||
<x:scenario label="Given m:oMathPara, containing m:aln in descendants"> | ||
<x:context mode="wml-to-dbk"> | ||
<w:document> | ||
<w:p> | ||
<tabs xmlns="http:https://docbook.org/ns/docbook"> | ||
<tab align="right" horizontal-position="305.8pt"/> | ||
</tabs> | ||
<m:oMathPara> | ||
<m:oMath> | ||
<m:r> | ||
<m:t>a</m:t> | ||
</m:r> | ||
<m:r> | ||
<m:rPr> | ||
<m:sty m:val="p"/> | ||
</m:rPr> | ||
<w:rPr> | ||
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/> | ||
</w:rPr> | ||
<w:br /> | ||
</m:r> | ||
</m:oMath> | ||
<m:oMath> | ||
<m:r> | ||
<w:rPr> | ||
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/> | ||
</w:rPr> | ||
<m:t>b</m:t> | ||
</m:r> | ||
</m:oMath> | ||
</m:oMathPara> | ||
</w:p> | ||
</w:document> | ||
</x:context> | ||
<x:expect label="mtable with maligngroup is generated"> | ||
<para xmlns="http:https://docbook.org/ns/docbook"> | ||
<tabs> | ||
<tab align="right" horizontal-position="305.8pt"/> | ||
</tabs> | ||
<equation role="omml"> | ||
<mml:math display="block"> | ||
<mml:mtable> | ||
<mml:mtr> | ||
<mml:mtd> | ||
<mml:mi>a</mml:mi> | ||
<mml:mspace linebreak="newline" /> | ||
</mml:mtd> | ||
</mml:mtr> | ||
<mml:mtr> | ||
<mml:mtd> | ||
<mml:mi>b</mml:mi> | ||
</mml:mtd> | ||
</mml:mtr> | ||
</mml:mtable> | ||
</mml:math> | ||
</equation> | ||
</para> | ||
</x:expect> | ||
</x:scenario> | ||
</x:description> |