@@ -111,6 +111,11 @@ main = do
111111 r11 <- runTest "native reader" ["-r", "native", "-w", "native", "-s"]
112112 "testsuite.native" "testsuite.native"
113113 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"
114119 r12s <- if runLhsTests
115120 then mapM runLhsWriterTest lhsWriterFormats
116121 else putStrLn "Skipping lhs writer tests because they presuppose highlighting support" >> return []
@@ -126,7 +131,8 @@ main = do
126131 , r10 -- latex
127132 , rTextile1 -- textile
128133 , r11 -- native
129− ] ++ r12s ++ r13s ++ r14s
134+ , r15 -- markdown citations
135+ ] ++ r12s ++ r13s ++ r14s ++ r16s ++ r17s
130136 if all id results
131137 then do
132138 putStrLn "\nAll tests passed."
@@ -149,6 +155,19 @@ runLhsReaderTest :: String -> IO Bool
149155runLhsReaderTest format =
150156 runTest ("(lhs) " ++ format ++ " reader") ["-r", format, "-w", "html+lhs"] ("lhs-test" <.> format) "lhs-test.fragment.html+lhs"
151157
158+
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
165+ ]
166+ where
167+ o' = o ++ ["--" ++ n]
168+ f = n ++ "-citations.latex"
169+ rt = runTest
170+
152171runWriterTest :: String -> IO Bool
153172runWriterTest format = do
154173 r1 <- runTest (format ++ " writer") ["-r", "native", "-s", "-w", format] "testsuite.native" ("writer" <.> format)