git.iko.soy/typeable/pandoc
on master help sign in
Fixed test suite to use Diff 0.2 API.
commit0675346e761f6831a8be312e11009555a14e3c72 authorJohn MacFarlane <fiddlosopher@gmail.com> dateWed 2 Jan 2013, 11:41 (14 years ago) parenta7cd65f
2 files changed+8−8
pandoc.cabal+1−1 tests/Tests/Helpers.hs+7−7
pandoc.cabal+1−1
@@ -361,7 +361,7 @@ Test-Suite test-pandoc
361361 directory >= 1 && < 1.3,
362362 filepath >= 1.1 && < 1.4,
363363 process >= 1 && < 1.2,
364− Diff,
364+ Diff >= 0.2 && < 0.3,
365365 test-framework >= 0.3 && < 0.7,
366366 test-framework-hunit >= 0.2 && < 0.3,
367367 test-framework-quickcheck2 >= 0.2.9 && < 0.3,
tests/Tests/Helpers.hs+7−7
@@ -62,17 +62,17 @@ test fn name (input, expected) =
6262 actual' = toString $ fn input
6363 expected' = toString expected
6464 diff = getDiff (lines expected') (lines actual')
65− expected'' = unlines $ map vividize $ filter (\(d,_) -> d /= S) diff
66− actual'' = unlines $ map vividize $ filter (\(d,_) -> d /= F) diff
65+ expected'' = unlines $ map vividize [Second x | Second x <- diff]
66+ actual'' = unlines $ map vividize [First x | First x <- diff]
6767 dashes "" = replicate 72 '-'
6868 dashes x = replicate (72 - length x - 5) '-' ++ " " ++ x ++ " ---"
6969
70−vividize :: (DI,String) -> String
71−vividize (B,s) = s
72−vividize (F,s) = s
73−vividize (S,s) = setSGRCode [SetColor Background Dull Red
70+vividize :: Diff String -> String
71+vividize (Both s _) = s
72+vividize (First s) = s
73+vividize (Second s) = setSGRCode [SetColor Background Dull Red
7474 , SetColor Foreground Vivid White] ++ s
75− ++ setSGRCode [Reset]
75+ ++ setSGRCode [Reset]
7676
7777property :: QP.Testable a => TestName -> a -> Test
7878property = testProperty