aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-19 09:38:14 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-19 09:38:14 -0800
commit831889bebcca9e226e8868396d3b707c57e871b9 (patch)
treef8f6c4fa7a782ccc6c79c329f342eae1bd77198d /tests/Tests
parent608d5bc75397b3c20e808ff227d15d5a6c3a8964 (diff)
downloadpandoc-831889bebcca9e226e8868396d3b707c57e871b9.tar.gz
Unit tests: On failure, print the input string.
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Helpers.hs10
-rw-r--r--tests/Tests/Readers/LaTeX.hs4
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs
index 08cc9b63b..6bf266508 100644
--- a/tests/Tests/Helpers.hs
+++ b/tests/Tests/Helpers.hs
@@ -11,7 +11,7 @@ import Test.HUnit hiding (Test)
-- in Helpers
class Expect a where
- (=?>) :: Pandoc -> a -> Assertion
+ (=?>) :: (String, Pandoc) -> a -> Assertion
infix 8 =?>
@@ -21,12 +21,12 @@ infix 8 =?>
infix 6 =:
instance Expect Inlines where
- (Pandoc _ [Para ils]) =?> e = assertEqual " " (toList e) ils
- g =?> e = assertEqual " " (doc $ para e) g
+ (s, Pandoc _ [Para ils]) =?> e = assertEqual s (toList e) ils
+ (s, g) =?> e = assertEqual s (doc $ para e) g
instance Expect Blocks where
- (Pandoc _ bls) =?> e = assertEqual " " (toList e) bls
+ (s, Pandoc _ bls) =?> e = assertEqual s (toList e) bls
instance Expect Pandoc where
- g =?> e = assertEqual " " e g
+ (s, g) =?> e = assertEqual s e g
diff --git a/tests/Tests/Readers/LaTeX.hs b/tests/Tests/Readers/LaTeX.hs
index 3a0a9b57a..71eaff79f 100644
--- a/tests/Tests/Readers/LaTeX.hs
+++ b/tests/Tests/Readers/LaTeX.hs
@@ -7,8 +7,8 @@ import Text.Pandoc.Builder
import Text.Pandoc
import Text.Pandoc.Shared (normalize)
-latex :: String -> Pandoc
-latex = normalize . readLaTeX defaultParserState{stateSmart = True}
+latex :: String -> (String, Pandoc)
+latex s = (s, normalize . readLaTeX defaultParserState{stateSmart = True} $ s)
tests :: [Test]
tests = [ testGroup "basic"