diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-22 12:18:59 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-22 12:18:59 -0800 |
commit | 209b300d6adeb2427c0058b808945ac39f851b24 (patch) | |
tree | 6ba5f255711fdd58fdf6d9d219d55e30b7f0a362 /tests/Tests/Writers | |
parent | d86d9260df7fc9addccd289df7a15d9b36b21ae1 (diff) | |
download | pandoc-209b300d6adeb2427c0058b808945ac39f851b24.tar.gz |
Added 'property' in Tests.Helpers & some quickcheck tests.
Diffstat (limited to 'tests/Tests/Writers')
-rw-r--r-- | tests/Tests/Writers/ConTeXt.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/Tests/Writers/ConTeXt.hs b/tests/Tests/Writers/ConTeXt.hs index 9b59c617d..6f380713c 100644 --- a/tests/Tests/Writers/ConTeXt.hs +++ b/tests/Tests/Writers/ConTeXt.hs @@ -5,10 +5,15 @@ import Test.Framework import Text.Pandoc.Builder import Text.Pandoc import Tests.Helpers +import Tests.Arbitrary() context :: (ToString a, ToPandoc a) => a -> String context = writeConTeXt defaultWriterOptions . toPandoc +context' :: (ToString a, ToPandoc a) => a -> String +context' = writeConTeXt defaultWriterOptions{ writerWrapText = False } + . toPandoc + {- "my test" =: X =?> Y @@ -30,10 +35,17 @@ tests :: [Test] tests = [ testGroup "inline code" [ "with '}'" =: code "}" =?> "\\mono{\\letterclosebrace{}}" , "without '}'" =: code "]" =?> "\\type{]}" + , property "code property" $ \s -> null s || + if '{' `elem` s || '}' `elem` s + then (context' $ code s) == "\\mono{" ++ + (context' $ str s) ++ "}" + else (context' $ code s) == "\\type{" ++ s ++ "}" ] , testGroup "headers" [ "level 1" =: header 1 "My header" =?> "\\subject{My header}" + , property "header 1 property" $ \ils -> + context' (header 1 ils) == "\\subject{" ++ context' ils ++ "}" ] , testGroup "bullet lists" [ "nested" =: |