Merge pull request #72 from jfdm/make-test-output-better

Print expected and given output when test fails.
This commit is contained in:
Edwin Brady 2019-08-29 10:52:30 +01:00 committed by GitHub
commit 0a8b50d31f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,9 +85,15 @@ runTest prog testPath
Right exp <- readFile "expected"
| Left err => do print err
pure False
if (out == exp)
then putStrLn "success"
else putStrLn "FAILURE"
else do
putStrLn "FAILURE"
putStrLn "Expected:"
printLn exp
putStrLn "Given:"
printLn out
chdir "../.."
pure (out == exp)