@@ -5,10 +5,15 @@ import Test.Framework
55import Text.Pandoc.Builder
66import Text.Pandoc
77import Tests.Helpers
8+import Tests.Arbitrary()
89
910context :: (ToString a, ToPandoc a) => a -> String
1011context = writeConTeXt defaultWriterOptions . toPandoc
1112
13+context' :: (ToString a, ToPandoc a) => a -> String
14+context' = writeConTeXt defaultWriterOptions{ writerWrapText = False }
15+ . toPandoc
16+
1217{-
1318 "my test" =: X =?> Y
1419
@@ -30,10 +35,17 @@ tests :: [Test]
3035tests = [ testGroup "inline code"
3136 [ "with '}'" =: code "}" =?> "\\mono{\\letterclosebrace{}}"
3237 , "without '}'" =: code "]" =?> "\\type{]}"
38+ , property "code property" $ \s -> null s ||
39+ if '{' `elem` s || '}' `elem` s
40+ then (context' $ code s) == "\\mono{" ++
41+ (context' $ str s) ++ "}"
42+ else (context' $ code s) == "\\type{" ++ s ++ "}"
3343 ]
3444 , testGroup "headers"
3545 [ "level 1" =:
3646 header 1 "My header" =?> "\\subject{My header}"
47+ , property "header 1 property" $ \ils ->
48+ context' (header 1 ils) == "\\subject{" ++ context' ils ++ "}"
3749 ]
3850 , testGroup "bullet lists"
3951 [ "nested" =: