Commit 5c9d91be authored by Camil Staps's avatar Camil Staps 🙂

Implement human-readable variant of CounterExamples

parent 17035cfc
......@@ -373,7 +373,8 @@ where
FailedAssertions fas -> "\n Failed assumptions:\n " +++
replaceSubString "\n" "\n "
(replaceSubString "\t" " " $ join "\n" $ map printFA fas)
CounterExamples ces -> "\n CES"
CounterExamples ces -> "\n Counter-examples:\n - " +++
join "\n - " (map (replaceSubString "\n" "\n " o printCE) ces)
FailedChildren fcs -> "\n Children tests failed: " +++ join ", " (map fst fcs)
Crashed -> "\n Crashed"
_ -> ""
......@@ -383,6 +384,11 @@ where
Eq -> diffToConsole $ gDiff{|*|} x y
_ -> toString x +++ "\n" +++ toString y
printCE :: CounterExample -> String
printCE ce = join " " (map toString ce.counterExample) +++ case ce.failedAssertions of
[] -> ""
fas -> ":\n" +++ join "\n" (map printFA ce.failedAssertions)
return :: !EndEventType !TestRun !*File !*World -> *(!RunResult, !*World)
return eet r io w
# (_,w) = fclose io w
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment