git.iko.soy/typeable/pandoc
on master help sign in
Added Tests.Writer.AsciiDoc to repository.
6b532c2John MacFarlane
tests/Tests/Writers/AsciiDoc.hsnew file+37
@@ -0,0 +1,37 @@
1+{-# LANGUAGE OverloadedStrings #-}
2+module Tests.Writers.AsciiDoc (tests) where
3+
4+import Test.Framework
5+import Text.Pandoc.Builder
6+import Text.Pandoc
7+import Tests.Helpers
8+import Tests.Arbitrary()
9+import Data.Monoid
10+
11+asciidoc :: (ToString a, ToPandoc a) => a -> String
12+asciidoc = writeAsciiDoc def{ writerWrapText = False } . toPandoc
13+
14+tests :: [Test]
15+tests = [ testGroup "tables"
16+ [ test asciidoc "empty cells" $
17+ simpleTable [] [[mempty],[mempty]] =?> unlines
18+ [ "[cols=\"\",]"
19+ , "|===="
20+ , "|"
21+ , "|"
22+ , "|===="
23+ ]
24+ , test asciidoc "multiblock cells" $
25+ simpleTable [] [[para "Para 1" <> para "Para 2"]]
26+ =?> unlines
27+ [ "[cols=\"\",]"
28+ , "|====="
29+ , "a|"
30+ , "Para 1"
31+ , ""
32+ , "Para 2"
33+ , ""
34+ , "|====="
35+ ]
36+ ]
37+ ]