2011-01-21 10:23:41 -08:00
|
|
|
{-# 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
|
|
|
|
|
2011-01-21 11:02:59 -08:00
|
|
|
inlines :: Inlines -> (Inlines, String)
|
|
|
|
inlines ils = (ils, removeTrailingSpace .
|
|
|
|
writeConTeXt defaultWriterOptions . doc . plain $ ils)
|
2011-01-21 10:23:41 -08:00
|
|
|
|
2011-01-21 11:02:59 -08:00
|
|
|
blocks :: Blocks -> (Blocks, String)
|
|
|
|
blocks bls = (bls, writeConTeXt defaultWriterOptions . doc $ bls)
|
2011-01-21 10:23:41 -08:00
|
|
|
|
|
|
|
tests :: [Test]
|
|
|
|
tests = [ testGroup "inline code"
|
|
|
|
[ "with '}'" =:
|
2011-01-21 11:02:59 -08:00
|
|
|
inlines (code "}") --> "\\mono{\\letterclosebrace{x}}"
|
2011-01-21 10:23:41 -08:00
|
|
|
, "without '}'" =:
|
|
|
|
inlines (code "]") --> "\\type{]}"
|
|
|
|
]
|
|
|
|
, testGroup "headers"
|
|
|
|
[ "level 1" =:
|
|
|
|
blocks (header 1 "My header") --> "\\subject{My header}"
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|