aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-05-03 22:33:36 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-05-03 22:33:36 -0700
commit6b532c2131f13f5c294dcea88a8d041f8be388dd (patch)
treef762947903e896d369e533a8dd02e7d7a82ec2ec /tests/Tests
parent9625cf6f40ddb6e3683a6435f15cd1d3ba74a281 (diff)
downloadpandoc-6b532c2131f13f5c294dcea88a8d041f8be388dd.tar.gz
Added Tests.Writer.AsciiDoc to repository.
Diffstat (limited to 'tests/Tests')
-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"
+ , ""
+ , "|====="
+ ]
+ ]
+ ]