From 933cdaf4c88b2b5aa45bd2f09b71e8d28b605a10 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 19 Jan 2011 09:44:53 -0800 Subject: Show Haskell-readable version of input string in test failure. --- tests/Tests/Helpers.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/Tests') diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs index 6bf266508..6a677f7b9 100644 --- a/tests/Tests/Helpers.hs +++ b/tests/Tests/Helpers.hs @@ -9,7 +9,9 @@ import Test.Framework import Test.Framework.Providers.HUnit import Test.HUnit hiding (Test) --- in Helpers +-- In the first argument, the String is the input, and the Pandoc +-- the output, of a pandoc reader. The input is shown in case +-- the test fails. class Expect a where (=?>) :: (String, Pandoc) -> a -> Assertion @@ -21,12 +23,12 @@ infix 8 =?> infix 6 =: instance Expect Inlines where - (s, Pandoc _ [Para ils]) =?> e = assertEqual s (toList e) ils - (s, g) =?> e = assertEqual s (doc $ para e) g + (s, Pandoc _ [Para ils]) =?> e = assertEqual (show s) (toList e) ils + (s, g) =?> e = assertEqual (show s) (doc $ para e) g instance Expect Blocks where - (s, Pandoc _ bls) =?> e = assertEqual s (toList e) bls + (s, Pandoc _ bls) =?> e = assertEqual (show s) (toList e) bls instance Expect Pandoc where - (s, g) =?> e = assertEqual s e g + (s, g) =?> e = assertEqual (show s) e g -- cgit v1.2.3