diff options
author | John MacFarlane <jgm@berkeley.edu> | 2012-07-26 08:37:36 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2012-07-26 08:37:36 -0700 |
commit | 45e4c123a45b83d666088967c25b91cf9bb5db72 (patch) | |
tree | b3662354ccacd88b0d9238b3d0c049c4c876abc4 /tests/Tests/Writers/LaTeX.hs | |
parent | 3053267280bfd7b255f3bf47480e4a8a97ec2915 (diff) | |
download | pandoc-45e4c123a45b83d666088967c25b91cf9bb5db72.tar.gz |
Moved tests to tests/, modified cabal file so lib isn't recompiled.
Diffstat (limited to 'tests/Tests/Writers/LaTeX.hs')
-rw-r--r-- | tests/Tests/Writers/LaTeX.hs | 35 |
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}" + ] + ] |