summaryrefslogtreecommitdiff
path: root/tests/Tests/Writers/AsciiDoc.hs
blob: 118e648d32bbf6dee54ec6745acf0937127db90e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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"
                                           , ""
                                           , "|====="
                                           ]
          ]
        ]