diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-19 09:44:53 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-19 09:44:53 -0800 |
commit | 933cdaf4c88b2b5aa45bd2f09b71e8d28b605a10 (patch) | |
tree | ee5fa7892c2bbe17c4fe9a12be39afc37b0adca0 /tests/Tests | |
parent | 831889bebcca9e226e8868396d3b707c57e871b9 (diff) |
Show Haskell-readable version of input string in test failure.
Diffstat (limited to 'tests/Tests')
-rw-r--r-- | tests/Tests/Helpers.hs | 12 |
1 files changed, 7 insertions, 5 deletions
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 |