aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-21 11:02:59 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-21 11:02:59 -0800
commitd43dbc83f286bb5ace3cf64d1cba45448ce17f37 (patch)
treeb1c60d0a1cb868706607b9a0cf72002a1d5b24cb
parentd0726920db29fee60f09c45be2974bf8d9eb464f (diff)
downloadpandoc-d43dbc83f286bb5ace3cf64d1cba45448ce17f37.tar.gz
More informative output on writer test failure.
-rw-r--r--tests/Tests/Helpers.hs4
-rw-r--r--tests/Tests/Writers/ConTeXt.hs12
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs
index f8236a54b..67de55dcc 100644
--- a/tests/Tests/Helpers.hs
+++ b/tests/Tests/Helpers.hs
@@ -11,8 +11,8 @@ import Test.HUnit hiding (Test)
infix 8 -->
-(-->) :: (Eq a, Show a) => a -> a -> Assertion
-a --> e = assertEqual " " e a
+(-->) :: (Eq a, Show a, Show b) => (b, a) -> a -> Assertion
+(b,a) --> e = assertEqual (show b) e a
-- In the first argument, the String is the input, and the Pandoc
-- the output, of a pandoc reader. The input is shown in case
diff --git a/tests/Tests/Writers/ConTeXt.hs b/tests/Tests/Writers/ConTeXt.hs
index cdc98be5d..1a887de1f 100644
--- a/tests/Tests/Writers/ConTeXt.hs
+++ b/tests/Tests/Writers/ConTeXt.hs
@@ -7,17 +7,17 @@ import Text.Pandoc
import Text.Pandoc.Shared (removeTrailingSpace)
import Tests.Helpers
-inlines :: Inlines -> String
-inlines = removeTrailingSpace .
- writeConTeXt defaultWriterOptions . doc . plain
+inlines :: Inlines -> (Inlines, String)
+inlines ils = (ils, removeTrailingSpace .
+ writeConTeXt defaultWriterOptions . doc . plain $ ils)
-blocks :: Blocks -> String
-blocks = writeConTeXt defaultWriterOptions . doc
+blocks :: Blocks -> (Blocks, String)
+blocks bls = (bls, writeConTeXt defaultWriterOptions . doc $ bls)
tests :: [Test]
tests = [ testGroup "inline code"
[ "with '}'" =:
- inlines (code "}") --> "\\mono{\\letterclosebrace{}}"
+ inlines (code "}") --> "\\mono{\\letterclosebrace{x}}"
, "without '}'" =:
inlines (code "]") --> "\\type{]}"
]