summaryrefslogtreecommitdiff
path: root/src/Tests/Writers
diff options
context:
space:
mode:
authorClint Adams <clint@debian.org>2012-06-30 07:07:05 -0400
committerClint Adams <clint@debian.org>2012-06-30 07:07:05 -0400
commit138907db4677220dd4bfe17cc243220cd37762db (patch)
tree73104d10535c915fffc78c86464896bdfeb4fd1b /src/Tests/Writers
parentf16ccad90c42feb754b6bc13d107759a04bb31c7 (diff)
Imported Upstream version 1.9.4.2
Diffstat (limited to 'src/Tests/Writers')
-rw-r--r--src/Tests/Writers/ConTeXt.hs2
-rw-r--r--src/Tests/Writers/LaTeX.hs35
2 files changed, 36 insertions, 1 deletions
diff --git a/src/Tests/Writers/ConTeXt.hs b/src/Tests/Writers/ConTeXt.hs
index 506ff698f..beb6411f0 100644
--- a/src/Tests/Writers/ConTeXt.hs
+++ b/src/Tests/Writers/ConTeXt.hs
@@ -33,7 +33,7 @@ infix 4 =:
tests :: [Test]
tests = [ testGroup "inline code"
- [ "with '}'" =: code "}" =?> "\\mono{\\letterclosebrace{}}"
+ [ "with '}'" =: code "}" =?> "\\mono{\\}}"
, "without '}'" =: code "]" =?> "\\type{]}"
, property "code property" $ \s -> null s ||
if '{' `elem` s || '}' `elem` s
diff --git a/src/Tests/Writers/LaTeX.hs b/src/Tests/Writers/LaTeX.hs
new file mode 100644
index 000000000..7987716f3
--- /dev/null
+++ b/src/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}"
+ ]
+ ]