Skip to content

Commit

Permalink
More informative error messages for test_throws
Browse files Browse the repository at this point in the history
  • Loading branch information
kshramt committed Dec 24, 2014
1 parent db7dc0a commit be699b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ end
function do_test_throws(body, qex, bt, extype)
handler()(try
body()
Failure(qex)
Failure(qex, "$qex did not throw $(extype == nothing ? "anything" : extype)")
catch err
if extype == nothing
Base.warn("""
Expand All @@ -66,7 +66,7 @@ function do_test_throws(body, qex, bt, extype)
if isa(err, extype)
Success(qex)
else
Failure(qex)
Failure(qex, "$err was thrown instead of $extype")
end
end
end)
Expand Down

0 comments on commit be699b5

Please sign in to comment.