Added lhs reader tests. (One case fails.)

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1539 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2009-02-14 04:08:06 +00:00
parent 4a2fcd26cd
commit 0d2439949e
2 changed files with 59 additions and 1 deletions

View file

@ -60,6 +60,12 @@ lhsWriterFormats = [ "markdown"
, "html+lhs"
]
lhsReaderFormats :: [String]
lhsReaderFormats = [ "markdown+lhs"
, "rst+lhs"
, "latex+lhs"
]
main :: IO ()
main = do
r1s <- mapM runWriterTest writerFormats
@ -83,7 +89,8 @@ main = do
r11 <- runTest "native reader" ["-r", "native", "-w", "native", "-s"]
"testsuite.native" "testsuite.native"
r12s <- mapM runLhsWriterTest lhsWriterFormats
let results = r1s ++ [r2, r3, r4, r5, r6, r7, r7a, r8, r9, r10, r11] ++ r12s
r13s <- mapM runLhsReaderTest lhsReaderFormats
let results = r1s ++ [r2, r3, r4, r5, r6, r7, r7a, r8, r9, r10, r11] ++ r12s ++ r13s
if all id results
then do
putStrLn "\nAll tests passed."
@ -102,6 +109,10 @@ runLhsWriterTest :: String -> IO Bool
runLhsWriterTest format =
runTest ("(lhs) " ++ format ++ " writer") ["-r", "native", "-s", "-w", format] "lhs-test.native" ("lhs-test" <.> format)
runLhsReaderTest :: String -> IO Bool
runLhsReaderTest format =
runTest ("(lhs) " ++ format ++ " reader") ["-r", format, "-w", "html+lhs"] ("lhs-test" <.> format) "lhs-test.fragment.html+lhs"
runWriterTest :: String -> IO Bool
runWriterTest format = do
r1 <- runTest (format ++ " writer") ["-r", "native", "-s", "-w", format] "testsuite.native" ("writer" <.> format)

View file

@ -0,0 +1,47 @@
<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 literatehaskell"
><code
><span class="Char Special"
>&gt;</span
><span class="Function FunctionDefinition"
> unsplit ::</span
><span class="Normal NormalText"
> (Arrow a) =&gt; (b -&gt; c -&gt; d) -&gt; a (b, c) d</span
><br
/><span class="Char Special"
>&gt;</span
><span class="Normal NormalText"
> unsplit = arr . </span
><span class="Function"
>uncurry</span
><span class="Normal NormalText"
> </span
><br
/><span class="Char Special"
>&gt;</span
><span class="Normal NormalText"
> </span
><span class="Comment"
>-- arr (\op (x,y) -&gt; x `op` y) </span
><br
/></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 &gt;&gt;&gt; second g
</code
></pre
><blockquote
><p
>Here is a block quote section.</p
></blockquote
>