git.iko.soy/typeable/pandoc
on master help sign in
Added lhs reader tests. (One case fails.)

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1539 788f1e2b-df1e-0410-8736-df70ead52e1b

commit0d2439949ea679c3be8918df356100b40f7be357 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 14 Feb 2009, 04:08 (18 years ago) parent4a2fcd2
2 files changed+59−1
tests/RunTests.hs+12−1 tests/lhs-test.fragment.html+lhs+47
tests/RunTests.hs+12−1
@@ -60,6 +60,12 @@ lhsWriterFormats = [ "markdown"
6060 , "html+lhs"
6161 ]
6262
63+lhsReaderFormats :: [String]
64+lhsReaderFormats = [ "markdown+lhs"
65+ , "rst+lhs"
66+ , "latex+lhs"
67+ ]
68+
6369main :: IO ()
6470main = do
6571 r1s <- mapM runWriterTest writerFormats
@@ -83,7 +89,8 @@ main = do
8389 r11 <- runTest "native reader" ["-r", "native", "-w", "native", "-s"]
8490 "testsuite.native" "testsuite.native"
8591 r12s <- mapM runLhsWriterTest lhsWriterFormats
86− let results = r1s ++ [r2, r3, r4, r5, r6, r7, r7a, r8, r9, r10, r11] ++ r12s
92+ r13s <- mapM runLhsReaderTest lhsReaderFormats
93+ let results = r1s ++ [r2, r3, r4, r5, r6, r7, r7a, r8, r9, r10, r11] ++ r12s ++ r13s
8794 if all id results
8895 then do
8996 putStrLn "\nAll tests passed."
@@ -102,6 +109,10 @@ runLhsWriterTest :: String -> IO Bool
102109runLhsWriterTest format =
103110 runTest ("(lhs) " ++ format ++ " writer") ["-r", "native", "-s", "-w", format] "lhs-test.native" ("lhs-test" <.> format)
104111
112+runLhsReaderTest :: String -> IO Bool
113+runLhsReaderTest format =
114+ runTest ("(lhs) " ++ format ++ " reader") ["-r", format, "-w", "html+lhs"] ("lhs-test" <.> format) "lhs-test.fragment.html+lhs"
115+
105116runWriterTest :: String -> IO Bool
106117runWriterTest format = do
107118 r1 <- runTest (format ++ " writer") ["-r", "native", "-s", "-w", format] "testsuite.native" ("writer" <.> format)
tests/lhs-test.fragment.html+lhsnew file+47
@@ -0,0 +1,47 @@
1+<h1 id="lhs-test"
2+>lhs test</h1
3+><p
4+><code
5+ >unsplit</code
6+ > is an arrow that takes a pair of values and combines them to return a single value:</p
7+><pre class="sourceCode literatehaskell"
8+><code
9+ ><span class="Char Special"
10+ >&gt;</span
11+ ><span class="Function FunctionDefinition"
12+ > unsplit ::</span
13+ ><span class="Normal NormalText"
14+ > (Arrow a) =&gt; (b -&gt; c -&gt; d) -&gt; a (b, c) d</span
15+ ><br
16+ /><span class="Char Special"
17+ >&gt;</span
18+ ><span class="Normal NormalText"
19+ > unsplit = arr . </span
20+ ><span class="Function"
21+ >uncurry</span
22+ ><span class="Normal NormalText"
23+ > </span
24+ ><br
25+ /><span class="Char Special"
26+ >&gt;</span
27+ ><span class="Normal NormalText"
28+ > </span
29+ ><span class="Comment"
30+ >-- arr (\op (x,y) -&gt; x `op` y) </span
31+ ><br
32+ /></code
33+ ></pre
34+><p
35+><code
36+ >(***)</code
37+ > 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
38+><pre
39+><code
40+ >f *** g = first f &gt;&gt;&gt; second g
41+</code
42+ ></pre
43+><blockquote
44+><p
45+ >Here is a block quote section.</p
46+ ></blockquote
47+>