@@ -111,6 +111,11 @@ main = do
111 r11 <- runTest "native reader" ["-r", "native", "-w", "native", "-s"]
111 r11 <- runTest "native reader" ["-r", "native", "-w", "native", "-s"]
112 "testsuite.native" "testsuite.native"
112 "testsuite.native" "testsuite.native"
113 r14s <- mapM (\style -> runTest ("markdown reader (citations) (" ++ style ++ ")") ["-r", "markdown", "-w", "markdown", "--bibliography", "biblio.bib", "--csl", style ++ ".csl", "--no-wrap"] "markdown-citations.txt" ("markdown-citations." ++ style ++ ".txt")) ["chicago-author-date","ieee","mhra"]
113 r14s <- mapM (\style -> runTest ("markdown reader (citations) (" ++ style ++ ")") ["-r", "markdown", "-w", "markdown", "--bibliography", "biblio.bib", "--csl", style ++ ".csl", "--no-wrap"] "markdown-citations.txt" ("markdown-citations." ++ style ++ ".txt")) ["chicago-author-date","ieee","mhra"]
114+ let citopts = ["--bibliography", "biblio.bib", "--csl", "chicago-author-date.csl", "--no-citeproc"]
115+ r15 <- runTest "markdown writer (citations)" (["-r", "markdown", "-w", "markdown"] ++ citopts)
116+ "markdown-citations.txt" "markdown-citations.txt"
117+ r16s <- runLatexCitationTests citopts "biblatex"
118+ r17s <- runLatexCitationTests citopts "natbib"
114 r12s <- if runLhsTests
119 r12s <- if runLhsTests
115 then mapM runLhsWriterTest lhsWriterFormats
120 then mapM runLhsWriterTest lhsWriterFormats
116 else putStrLn "Skipping lhs writer tests because they presuppose highlighting support" >> return []
121 else putStrLn "Skipping lhs writer tests because they presuppose highlighting support" >> return []
@@ -126,7 +131,8 @@ main = do
126 , r10 -- latex
131 , r10 -- latex
127 , rTextile1 -- textile
132 , rTextile1 -- textile
128 , r11 -- native
133 , r11 -- native
134+ , r15 -- markdown citations
129− ] ++ r12s ++ r13s ++ r14s
135+ ] ++ r12s ++ r13s ++ r14s ++ r16s ++ r17s
130 if all id results
136 if all id results
132 putStrLn "\nAll tests passed."
138 putStrLn "\nAll tests passed."
@@ -149,6 +155,19 @@ runLhsReaderTest :: String -> IO Bool
149runLhsReaderTest format =
155runLhsReaderTest format =
150 runTest ("(lhs) " ++ format ++ " reader") ["-r", format, "-w", "html+lhs"] ("lhs-test" <.> format) "lhs-test.fragment.html+lhs"
156 runTest ("(lhs) " ++ format ++ " reader") ["-r", format, "-w", "html+lhs"] ("lhs-test" <.> format) "lhs-test.fragment.html+lhs"
159+runLatexCitationTests :: [String] -> String -> IO [Bool]
160+runLatexCitationTests o n
161+ = sequence [ rt ("latex reader (" ++ n ++ " citations)") (["-r", "latex", "-w", "markdown", "-s"] ++ o')
162+ f "markdown-citations.txt"
163+ , rt ("latex writer (" ++ n ++ " citations)") (["-r", "markdown", "-w", "latex", "-s"] ++ o')
164+ "markdown-citations.txt" f
167+ o' = o ++ ["--" ++ n]
168+ f = n ++ "-citations.latex"
152runWriterTest :: String -> IO Bool
171runWriterTest :: String -> IO Bool
153runWriterTest format = do
172runWriterTest format = do
154 r1 <- runTest (format ++ " writer") ["-r", "native", "-s", "-w", format] "testsuite.native" ("writer" <.> format)
173 r1 <- runTest (format ++ " writer") ["-r", "native", "-s", "-w", format] "testsuite.native" ("writer" <.> format)