diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-21 10:23:41 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-21 10:23:41 -0800 |
commit | d0726920db29fee60f09c45be2974bf8d9eb464f (patch) | |
tree | 023a6dc2c0d5a43048dae7a735dd8f9d2bab72b1 /tests/Tests/Writers | |
parent | 5c35be13625895f52c66f98be81751b49b1b0365 (diff) |
Added Tests.Writers.ConTeXt and helpers for writer tests.
Diffstat (limited to 'tests/Tests/Writers')
-rw-r--r-- | tests/Tests/Writers/ConTeXt.hs | 29 |
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}" + ] + ] + |