Skip to content

Commit e9e1f1c

Browse files
authored
Merge pull request #3 from hobovsky/cw-reporter
2 parents f8974d9 + e68da8e commit e9e1f1c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/FactCheck.jl

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,17 @@ function Base.show(io::IO, f::Failure)
113113
end
114114

115115
function Base.show(io::IO, e::Error)
116-
println(io, "\n<IT::>", replace_lf(e.meta.msg != nothing ? "$(e.meta.msg)" : format_fact(e.expr)))
117-
println(io, "\n<ERROR::>", replace_lf(sprint(showerror, e.err)))
116+
println(io, "\n<IT::>", replace_lf(format_fact(e.expr)))
117+
errorMsg = e.meta.msg != nothing ? sprint(print, e.meta.msg) : sprint(showerror, e.err)
118+
println(io, "\n<ERROR::>", replace_lf(errorMsg))
118119
println(io, "\n<LOG::-Stack trace>", replace_lf(sprint(showerror, e.err, e.backtrace)))
119120
println(io, "\n<COMPLETEDIN::>")
120121
end
121122

122123
function Base.show(io::IO, s::Success)
123-
if s.rhs == :fact_throws_error
124-
println(io, "\n<IT::>", replace_lf(s.meta.msg != nothing ? "$(s.meta.msg)" : "Throws Error"))
125-
println(io, "\n<PASSED::>Test Passed")
126-
println(io, "\n<COMPLETEDIN::>")
127-
else
128-
println(io, "\n<IT::>", replace_lf(s.meta.msg != nothing ? "$(s.meta.msg)" : format_fact(s.expr)))
129-
println(io, "\n<PASSED::>Test Passed")
130-
println(io, "\n<COMPLETEDIN::>")
131-
end
124+
println(io, "\n<IT::>", replace_lf(format_fact(s.expr)))
125+
println(io, "\n<PASSED::>Test Passed")
126+
println(io, "\n<COMPLETEDIN::>")
132127
end
133128

134129
function Base.show(io::IO, ::Pending)

0 commit comments

Comments
 (0)