From e9f1de639d80330b940c1b733a94bd9bf2ac8631 Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Wed, 12 Jan 2011 09:59:06 -0800 Subject: [PATCH] test diff output: put +/- at beginning of line. --- tests/Old.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Old.hs b/tests/Old.hs index 1d9540fdd..ef04f4a4e 100644 --- a/tests/Old.hs +++ b/tests/Old.hs @@ -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")