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 /tests | |
parent | a7cd65f2b3fee653555b83388530e8a9765bc22f (diff) | |
download | pandoc-0675346e761f6831a8be312e11009555a14e3c72.tar.gz |
Fixed test suite to use Diff 0.2 API.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Tests/Helpers.hs | 14 |
1 files changed, 7 insertions, 7 deletions
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 |