test diff output: put +/- at beginning of line.

This commit is contained in:
John MacFarlane 2011-01-12 09:59:06 -08:00
parent 3ebfcd0cea
commit e9f1de639d

View file

@ -38,9 +38,12 @@ instance Show TestResult where
showDiff :: (Int,Int) -> [(DI, String)] -> String
showDiff _ [] = ""
showDiff (l,r) ((F, ln) : ds) = printf "%4d +" l ++ ln ++ "\n" ++ showDiff (l+1,r) ds
showDiff (l,r) ((S, ln) : ds) = printf "%4d -" r ++ ln ++ "\n" ++ showDiff (l,r+1) ds
showDiff (l,r) ((B, _ ) : ds) = showDiff (l+1,r+1) ds
showDiff (l,r) ((F, ln) : ds) =
printf "+%4d " l ++ ln ++ "\n" ++ showDiff (l+1,r) ds
showDiff (l,r) ((S, ln) : ds) =
printf "-%4d " r ++ ln ++ "\n" ++ showDiff (l,r+1) ds
showDiff (l,r) ((B, _ ) : ds) =
showDiff (l+1,r+1) ds
tests :: [Test]
tests = [ testGroup "markdown" [ testGroup "writer" (writerTests "markdown" ++ lhsWriterTests "markdown")