aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.cabal2
-rw-r--r--tests/Tests/Helpers.hs14
2 files changed, 8 insertions, 8 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index c7f6aa555..5392d21c5 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -361,7 +361,7 @@ Test-Suite test-pandoc
directory >= 1 && < 1.3,
filepath >= 1.1 && < 1.4,
process >= 1 && < 1.2,
- Diff,
+ Diff >= 0.2 && < 0.3,
test-framework >= 0.3 && < 0.7,
test-framework-hunit >= 0.2 && < 0.3,
test-framework-quickcheck2 >= 0.2.9 && < 0.3,
diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs
index 5769a4985..9e00af456 100644
--- a/tests/Tests/Helpers.hs
+++ b/tests/Tests/Helpers.hs
@@ -62,17 +62,17 @@ test fn name (input, expected) =
actual' = toString $ fn input
expected' = toString expected
diff = getDiff (lines expected') (lines actual')
- expected'' = unlines $ map vividize $ filter (\(d,_) -> d /= S) diff
- actual'' = unlines $ map vividize $ filter (\(d,_) -> d /= F) diff
+ expected'' = unlines $ map vividize [Second x | Second x <- diff]
+ actual'' = unlines $ map vividize [First x | First x <- diff]
dashes "" = replicate 72 '-'
dashes x = replicate (72 - length x - 5) '-' ++ " " ++ x ++ " ---"
-vividize :: (DI,String) -> String
-vividize (B,s) = s
-vividize (F,s) = s
-vividize (S,s) = setSGRCode [SetColor Background Dull Red
+vividize :: Diff String -> String
+vividize (Both s _) = s
+vividize (First s) = s
+vividize (Second s) = setSGRCode [SetColor Background Dull Red
, SetColor Foreground Vivid White] ++ s
- ++ setSGRCode [Reset]
+ ++ setSGRCode [Reset]
property :: QP.Testable a => TestName -> a -> Test
property = testProperty