From 70b4ec95e4d1a565d32c074637bc3e3d203ce729 Mon Sep 17 00:00:00 2001 From: John MacFarlane <fiddlosopher@gmail.com> Date: Tue, 27 Dec 2011 18:08:06 -0800 Subject: [PATCH] Updated tests. --- tests/lhs-test.html | 44 ++++++++++++++++++++--------------------- tests/lhs-test.html+lhs | 44 ++++++++++++++++++++--------------------- tests/lhs-test.latex | 32 +++++++++++++++++++++++++----- tests/writer.html | 33 +++++++++++-------------------- 4 files changed, 80 insertions(+), 73 deletions(-) diff --git a/tests/lhs-test.html b/tests/lhs-test.html index 268dd9b27..b8f254fed 100644 --- a/tests/lhs-test.html +++ b/tests/lhs-test.html @@ -5,35 +5,33 @@ <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="generator" content="pandoc" /> <title></title> - <style type="text/css"> -/*<![CDATA[*/ -table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre - { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; } -td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; } +<style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { + margin: 0; padding: 0; vertical-align: baseline; border: none; } +table.sourceCode { } +td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } td.sourceCode { padding-left: 5px; } -code.sourceCode span.kw { color: #007020; font-weight: bold; } -code.sourceCode span.dt { color: #902000; } -code.sourceCode span.dv { color: #40a070; } -code.sourceCode span.bn { color: #40a070; } -code.sourceCode span.fl { color: #40a070; } -code.sourceCode span.ch { color: #4070a0; } -code.sourceCode span.st { color: #4070a0; } -code.sourceCode span.co { color: #60a0b0; font-style: italic; } -code.sourceCode span.ot { color: #007020; } -code.sourceCode span.al { color: red; font-weight: bold; } -code.sourceCode span.fu { color: #06287e; } -code.sourceCode span.re { } -code.sourceCode span.er { color: red; font-weight: bold; } -/*]]>*/ - </style> +code > span.kw { color: #007020; font-weight: bold; } +code > span.dt { color: #902000; } +code > span.dv { color: #40a070; } +code > span.bn { color: #40a070; } +code > span.fl { color: #40a070; } +code > span.ch { color: #4070a0; } +code > span.st { color: #4070a0; } +code > span.co { color: #60a0b0; font-style: italic; } +code > span.ot { color: #007020; } +code > span.al { color: #ff0000; font-weight: bold; } +code > span.fu { color: #06287e; } +code > span.er { color: #ff0000; font-weight: bold; } +</style> </head> <body> <h1 id="lhs-test">lhs test</h1> <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> -<pre class="sourceCode"><code class="sourceCode haskell"><span class="ot">unsplit </span><span class="ot">::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d<br />unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br /> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> +<pre class="sourceCode"><code class="sourceCode"><span class="ot">unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d +unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> + <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> -<pre><code>f *** g = first f >>> second g -</code></pre> +<pre><code>f *** g = first f >>> second g</code></pre> <p>Block quote:</p> <blockquote> <p>foo bar</p> diff --git a/tests/lhs-test.html+lhs b/tests/lhs-test.html+lhs index b9413f07a..f0b0f3e15 100644 --- a/tests/lhs-test.html+lhs +++ b/tests/lhs-test.html+lhs @@ -5,35 +5,33 @@ <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="generator" content="pandoc" /> <title></title> - <style type="text/css"> -/*<![CDATA[*/ -table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre - { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; } -td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; } +<style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { + margin: 0; padding: 0; vertical-align: baseline; border: none; } +table.sourceCode { } +td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } td.sourceCode { padding-left: 5px; } -code.sourceCode span.kw { color: #007020; font-weight: bold; } -code.sourceCode span.dt { color: #902000; } -code.sourceCode span.dv { color: #40a070; } -code.sourceCode span.bn { color: #40a070; } -code.sourceCode span.fl { color: #40a070; } -code.sourceCode span.ch { color: #4070a0; } -code.sourceCode span.st { color: #4070a0; } -code.sourceCode span.co { color: #60a0b0; font-style: italic; } -code.sourceCode span.ot { color: #007020; } -code.sourceCode span.al { color: red; font-weight: bold; } -code.sourceCode span.fu { color: #06287e; } -code.sourceCode span.re { } -code.sourceCode span.er { color: red; font-weight: bold; } -/*]]>*/ - </style> +code > span.kw { color: #007020; font-weight: bold; } +code > span.dt { color: #902000; } +code > span.dv { color: #40a070; } +code > span.bn { color: #40a070; } +code > span.fl { color: #40a070; } +code > span.ch { color: #4070a0; } +code > span.st { color: #4070a0; } +code > span.co { color: #60a0b0; font-style: italic; } +code > span.ot { color: #007020; } +code > span.al { color: #ff0000; font-weight: bold; } +code > span.fu { color: #06287e; } +code > span.er { color: #ff0000; font-weight: bold; } +</style> </head> <body> <h1 id="lhs-test">lhs test</h1> <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> -<pre class="sourceCode"><code class="sourceCode haskell">> <span class="ot">unsplit </span><span class="ot">::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d<br />> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br />> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> +<pre class="sourceCode"><code class="sourceCode"><span class="fu">></span><span class="ot"> unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d +<span class="fu">></span> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> +<span class="fu">></span> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> -<pre><code>f *** g = first f >>> second g -</code></pre> +<pre><code>f *** g = first f >>> second g</code></pre> <p>Block quote:</p> <blockquote> <p>foo bar</p> diff --git a/tests/lhs-test.latex b/tests/lhs-test.latex index 307fd948f..34b608c6a 100644 --- a/tests/lhs-test.latex +++ b/tests/lhs-test.latex @@ -12,6 +12,26 @@ \usepackage[utf8]{inputenc} \fi \fi +\usepackage{color} +\usepackage{fancyvrb} +\DefineShortVerb[commandchars=\\\{\}]{\|} +\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} +% Add ',fontsize=\small' for more characters per line +\newenvironment{Shaded}{}{} +\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} +\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} +\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} +\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} +\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} +\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} +\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} +\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}} +\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} +\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} +\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} +\newcommand{\RegionMarkerTok}[1]{{#1}} +\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} +\newcommand{\NormalTok}[1]{{#1}} \ifxetex \usepackage[setpagesize=false, % page size defined by xetex unicode=false, % unicode breaks when used with xetex @@ -33,11 +53,13 @@ \texttt{unsplit} is an arrow that takes a pair of values and combines them to return a single value: -\begin{verbatim} -unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d -unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) -\end{verbatim} +\begin{Shaded} +\begin{Highlighting}[] +\OtherTok{unsplit ::} \NormalTok{(}\DataTypeTok{Arrow} \NormalTok{a) }\OtherTok{=>} \NormalTok{(b }\OtherTok{->} \NormalTok{c }\OtherTok{->} \NormalTok{d) }\OtherTok{->} \NormalTok{a (b, c) d} +\NormalTok{unsplit }\FunctionTok{=} \NormalTok{arr }\FunctionTok{.} \FunctionTok{uncurry} + \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y) } +\end{Highlighting} +\end{Shaded} \texttt{(***)} combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair). diff --git a/tests/writer.html b/tests/writer.html index f38ad5079..0aaa6a1b3 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -45,8 +45,7 @@ <p>Code in a block quote:</p> <pre><code>sub status { print "working"; -} -</code></pre> +}</code></pre> <p>A list:</p> <ol style="list-style-type: decimal"> <li>item one</li> @@ -71,13 +70,11 @@ sub status { print "working"; } -this code block is indented by one tab -</code></pre> +this code block is indented by one tab</code></pre> <p>And:</p> <pre><code> this code block is indented by two tabs -These should not be escaped: \$ \\ \> \[ \{ -</code></pre> +These should not be escaped: \$ \\ \> \[ \{</code></pre> <hr /> <h1 id="lists">Lists</h1> <h2 id="unordered">Unordered</h2> @@ -274,8 +271,7 @@ These should not be escaped: \$ \\ \> \[ \{ </dd> <dt><em>orange</em></dt> <dd><p>orange fruit</p> -<pre><code>{ orange code block } -</code></pre> +<pre><code>{ orange code block }</code></pre> <blockquote> <p>orange block quote</p> </blockquote> @@ -358,11 +354,9 @@ foo <p>This should be a code block, though:</p> <pre><code><div> foo -</div> -</code></pre> +</div></code></pre> <p>As should this:</p> -<pre><code><div>foo</div> -</code></pre> +<pre><code><div>foo</div></code></pre> <p>Now, nested:</p> <div> <div> @@ -387,14 +381,12 @@ Blah --> <p>Code block:</p> -<pre><code><!-- Comment --> -</code></pre> +<pre><code><!-- Comment --></code></pre> <p>Just plain comment, with trailing spaces on the line:</p> <!-- foo --> <p>Code:</p> -<pre><code><hr /> -</code></pre> +<pre><code><hr /></code></pre> <p>Hr’s:</p> <hr> @@ -517,8 +509,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>') <p>Indented <a href="/url">twice</a>.</p> <p>Indented <a href="/url">thrice</a>.</p> <p>This should [not][] be a link.</p> -<pre><code>[not]: /url -</code></pre> +<pre><code>[not]: /url</code></pre> <p>Foo <a href="/url/" title="Title with "quotes" inside">bar</a>.</p> <p>Foo <a href="/url/" title="Title with "quote" inside">biz</a>.</p> <h2 id="with-ampersands">With ampersands</h2> @@ -543,8 +534,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+ <p>Blockquoted: <a href="http://example.com/"><code class="url">http://example.com/</code></a></p> </blockquote> <p>Auto-links should not occur here: <code><http://example.com/></code></p> -<pre><code>or here: <http://example.com/> -</code></pre> +<pre><code>or here: <http://example.com/></code></pre> <hr /> <h1 id="images">Images</h1> <p>From “Voyage dans la Lune” by Georges Melies (1902):</p> @@ -568,8 +558,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+ <li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document. <a href="#fnref1" class="footnoteBackLink">↩</a></p></li> <li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p> <p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p> -<pre><code> { <code> } -</code></pre> +<pre><code> { <code> }</code></pre> <p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. <a href="#fnref2" class="footnoteBackLink">↩</a></p></li> <li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text]. <a href="#fnref3" class="footnoteBackLink">↩</a></p></li> <li id="fn4"><p>In quote. <a href="#fnref4" class="footnoteBackLink">↩</a></p></li>