blob: cdc98be5d846ccefd8c5ac1c8c5997d3c8d46724 (
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
|
{-# 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}"
]
]
|