diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-02 11:41:22 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-02 11:41:22 -0800 |
commit | 0675346e761f6831a8be312e11009555a14e3c72 (patch) | |
tree | 2b85467d4f1a10832580017f21945bc6c8b8a149 | |
parent | a7cd65f2b3fee653555b83388530e8a9765bc22f (diff) | |
download | pandoc-0675346e761f6831a8be312e11009555a14e3c72.tar.gz |
Fixed test suite to use Diff 0.2 API.
-rw-r--r-- | pandoc.cabal | 2 | ||||
-rw-r--r-- | tests/Tests/Helpers.hs | 14 |
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 |