summaryrefslogtreecommitdiff
path: root/tests/Tests/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-21 10:23:41 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-21 10:23:41 -0800
commitd0726920db29fee60f09c45be2974bf8d9eb464f (patch)
tree023a6dc2c0d5a43048dae7a735dd8f9d2bab72b1 /tests/Tests/Writers
parent5c35be13625895f52c66f98be81751b49b1b0365 (diff)
Added Tests.Writers.ConTeXt and helpers for writer tests.
Diffstat (limited to 'tests/Tests/Writers')
-rw-r--r--tests/Tests/Writers/ConTeXt.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Tests/Writers/ConTeXt.hs b/tests/Tests/Writers/ConTeXt.hs
new file mode 100644
index 000000000..cdc98be5d
--- /dev/null
+++ b/tests/Tests/Writers/ConTeXt.hs
@@ -0,0 +1,29 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Tests.Writers.ConTeXt (tests) where
+
+import Test.Framework
+import Text.Pandoc.Builder
+import Text.Pandoc
+import Text.Pandoc.Shared (removeTrailingSpace)
+import Tests.Helpers
+
+inlines :: Inlines -> String
+inlines = removeTrailingSpace .
+ writeConTeXt defaultWriterOptions . doc . plain
+
+blocks :: Blocks -> String
+blocks = writeConTeXt defaultWriterOptions . doc
+
+tests :: [Test]
+tests = [ testGroup "inline code"
+ [ "with '}'" =:
+ inlines (code "}") --> "\\mono{\\letterclosebrace{}}"
+ , "without '}'" =:
+ inlines (code "]") --> "\\type{]}"
+ ]
+ , testGroup "headers"
+ [ "level 1" =:
+ blocks (header 1 "My header") --> "\\subject{My header}"
+ ]
+ ]
+