aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Writers/AsciiDoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Tests/Writers/AsciiDoc.hs')
-rw-r--r--tests/Tests/Writers/AsciiDoc.hs37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/Tests/Writers/AsciiDoc.hs b/tests/Tests/Writers/AsciiDoc.hs
new file mode 100644
index 000000000..118e648d3
--- /dev/null
+++ b/tests/Tests/Writers/AsciiDoc.hs
@@ -0,0 +1,37 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Tests.Writers.AsciiDoc (tests) where
+
+import Test.Framework
+import Text.Pandoc.Builder
+import Text.Pandoc
+import Tests.Helpers
+import Tests.Arbitrary()
+import Data.Monoid
+
+asciidoc :: (ToString a, ToPandoc a) => a -> String
+asciidoc = writeAsciiDoc def{ writerWrapText = False } . toPandoc
+
+tests :: [Test]
+tests = [ testGroup "tables"
+ [ test asciidoc "empty cells" $
+ simpleTable [] [[mempty],[mempty]] =?> unlines
+ [ "[cols=\"\",]"
+ , "|===="
+ , "|"
+ , "|"
+ , "|===="
+ ]
+ , test asciidoc "multiblock cells" $
+ simpleTable [] [[para "Para 1" <> para "Para 2"]]
+ =?> unlines
+ [ "[cols=\"\",]"
+ , "|====="
+ , "a|"
+ , "Para 1"
+ , ""
+ , "Para 2"
+ , ""
+ , "|====="
+ ]
+ ]
+ ]