Permalink
Browse files

Fixed test suite to use Diff 0.2 API.

  • Loading branch information...
1 parent a7cd65f commit 0675346e761f6831a8be312e11009555a14e3c72 John MacFarlane committed Jan 2, 2013
Showing with 8 additions and 8 deletions.
  1. +1 −1 pandoc.cabal
  2. +7 −7 tests/Tests/Helpers.hs
View
@@ -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,
View
@@ -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

0 comments on commit 0675346

Please sign in to comment.