summaryrefslogtreecommitdiff
path: root/tests/Tests/Writers/LaTeX.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Tests/Writers/LaTeX.hs')
-rw-r--r--tests/Tests/Writers/LaTeX.hs35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/Tests/Writers/LaTeX.hs b/tests/Tests/Writers/LaTeX.hs
new file mode 100644
index 000000000..7987716f3
--- /dev/null
+++ b/tests/Tests/Writers/LaTeX.hs
@@ -0,0 +1,35 @@
+{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
+module Tests.Writers.LaTeX (tests) where
+
+import Test.Framework
+import Text.Pandoc.Builder
+import Text.Pandoc
+import Tests.Helpers
+import Tests.Arbitrary()
+
+latex :: (ToString a, ToPandoc a) => a -> String
+latex = writeLaTeX defaultWriterOptions . toPandoc
+
+{-
+ "my test" =: X =?> Y
+
+is shorthand for
+
+ test latex "my test" $ X =?> Y
+
+which is in turn shorthand for
+
+ test latex "my test" (X,Y)
+-}
+
+infix 4 =:
+(=:) :: (ToString a, ToPandoc a)
+ => String -> (a, String) -> Test
+(=:) = test latex
+
+tests :: [Test]
+tests = [ testGroup "code blocks"
+ [ "in footnotes" =: note (para "hi" <> codeBlock "hi") =?>
+ "\\footnote{hi\n\n\\begin{Verbatim}\nhi\n\\end{Verbatim}\n}"
+ ]
+ ]