@@ -27,18 +27,18 @@ pandocPath = ".." </> "dist" </> "build" </> "pandoc" </> "pandoc"
2727
2828data TestResult = TestPassed
2929 | TestError ExitCode
30− | TestFailed [(DI, String)]
30+ | TestFailed FilePath [(DI, String)]
3131 deriving (Eq)
3232
3333instance Show TestResult where
3434 show TestPassed = "PASSED"
3535 show (TestError ec) = "ERROR " ++ show ec
36− show (TestFailed d) = "FAILED\n" ++ showDiff d
36+ show (TestFailed f d) = f ++ "\n--- expected test result\n+++ actual test result\n" ++ showDiff d
3737
3838showDiff :: [(DI, String)] -> String
3939showDiff [] = ""
40−showDiff ((F, ln) : ds) = "|TEST| " ++ ln ++ "\n" ++ showDiff ds
41−showDiff ((S, ln) : ds) = "|NORM| " ++ ln ++ "\n" ++ showDiff ds
40+showDiff ((F, ln) : ds) = "- " ++ ln ++ "\n" ++ showDiff ds
41+showDiff ((S, ln) : ds) = "+ " ++ ln ++ "\n" ++ showDiff ds
4242showDiff ((B, _ ) : ds) = showDiff ds
4343
4444tests :: [Test]
@@ -183,7 +183,7 @@ testWithNormalize normalizer testname opts inp norm = testCase testname $ do
183183 normContents <- readFile' normPath >>= return . filter (/='\r') . normalizer
184184 if outputContents == normContents
185185 then return TestPassed
186− else return $ TestFailed $ getDiff (lines outputContents) (lines normContents)
186+ else return $ TestFailed normPath $ getDiff (lines outputContents) (lines normContents)
187187 else return $ TestError ec
188188 removeFile outputPath
189189 assertBool (show result) (result == TestPassed)