Skip to content

Commit

Permalink
#161 Remove automatic visual regression testing for MathML.
Browse files Browse the repository at this point in the history
The MathML renderer (JEuclid) produces slightly different results on JDK8 vs JDK11 so is not suitable for auto testing.
  • Loading branch information
danfickle committed Jun 28, 2019
1 parent 0eca904 commit 02b43e8
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 10 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<html>
<head>
<style>
@font-face {
src: url(fonts/Karla-Bold.ttf);
font-family: 'MyFont';
font-weight: normal;
}
@page {
size: 10cm 30cm;
margin: 0;
}
body {
margin: 0;
font-family: 'MyFont';
font-size: 15px;
}
latex {
display: block;
width: 100%;
margin: 2px;
padding: 5px;
page-break-inside: avoid;
}
math {
font-family: 'MyFont';
}
</style>
</head>
<body>

<latex><![CDATA[
Simple list:
\begin{itemize}
\item First item
\item Second item
\end{itemize}
]]>
</latex>

<latex><![CDATA[
Here is a simple table without column lines:

\begin{tabular}{ l c r }
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{tabular}

In this table you get column lines:

\begin{tabular}{ l | c | r }
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{tabular}

And of course you can get both:
\begin{tabular}{ l | c | r }
\hline
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\hline
\end{tabular}
]]>
</latex>

<latex><![CDATA[
And even fancier:
\begin{center}
\begin{tabular}{ | l | c | r | }
\hline
1 & 2 & 3 \\ \hline
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\
\hline
\end{tabular}
\end{center}

The full possibilities of $L^AT_EX$:

\begin{tabular}{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}
]]>
</latex>

<latex><![CDATA[
Math:
$ \frac{x+1}{3y} $
$ x^{2^{y-z}} $
]]>
</latex>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
\end{tabular}
\end{center}

The full possibilities of $L^AT_EX$:
The full possibilities of Latex:

\begin{tabular}{|r|l|}
\hline
Expand All @@ -92,12 +92,5 @@
]]>
</latex>

<latex><![CDATA[
Math:
$ \frac{x+1}{3y} $
$ x^{2^{y-z}} $
]]>
</latex>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ public void testReplacedSizingSvgNonCss() throws IOException {
* Tests all the CSS sizing properties for MathML elements.
*/
@Test
@Ignore // MathML renderer produces slightly different results on JDK11 vs JDK8
// so can only be run manually.
public void testReplacedSizingMathMl() throws IOException {
assertTrue(vt.runTest("replaced-sizing-mathml", (builder) -> {
builder.useMathMLDrawer(new MathMLDrawer());
Expand All @@ -780,18 +782,31 @@ public void testReplacedSizingMathMl() throws IOException {
* the MathML plugin.
*/
@Test
@Ignore // MathML renderer produces slightly different results on JDK11 vs JDK8
// so can only be run manually.
public void testReplacedPluginLatexWithMath() throws IOException {
assertTrue(vt.runTest("replaced-plugin-latex-with-math", (builder) -> {
builder.addDOMMutator(LaTeXDOMMutator.INSTANCE);
builder.useMathMLDrawer(new MathMLDrawer());
}));
}

/**
* Tests Latex rendering without math. Separate test because we can not test
* Latex with math automatically because of the MathML rendering issue on
* different JDKs (see above).
*/
@Test
public void testReplacedPluginLatex() throws IOException {
assertTrue(vt.runTest("replaced-plugin-latex", (builder) -> {
builder.addDOMMutator(LaTeXDOMMutator.INSTANCE);
builder.useMathMLDrawer(new MathMLDrawer());
}));
}

// TODO:
// + Elements that appear just on generated overflow pages.
// + content property (page counters, etc)
// + Inline layers.
// + Replaced elements.
// + vertical page overflow, page-break-inside, etc.
// + CSS columns.
}

0 comments on commit 02b43e8

Please sign in to comment.