Skip to content

Commit

Permalink
Add error("unexpected") in try-catches that should fail
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman committed Oct 2, 2015
1 parent 52d940e commit bcd744d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/backtrace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ eval(Expr(:function, Expr(:call, :test_inline_2),

try
eval(:(test_inline_1()))
error("unexpected")
catch err
lkup = get_bt_frame(:test_inline_1, catch_backtrace())
if is(lkup, nothing)
Expand All @@ -51,6 +52,7 @@ catch err
end
try
eval(:(test_inline_2()))
error("unexpected")
catch err
lkup = get_bt_frame(:test_inline_2, catch_backtrace())
if is(lkup, nothing)
Expand Down
1 change: 1 addition & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ let deepthought(x, y) = 42
try
@assert 1 == 2 string("the answer to the ultimate question: ",
deepthought(6, 9))
error("unexpected")
catch ex
@test isa(ex, AssertionError)
@test ex.msg == "the answer to the ultimate question: 42"
Expand Down
2 changes: 2 additions & 0 deletions test/parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ try
@async error(i)
end
end
error("unexpected")
catch ex
@test typeof(ex) == CompositeException
@test length(ex) == 5
Expand All @@ -394,6 +395,7 @@ end

try
remotecall_fetch(()->throw(ErrorException("foobar")), id_other)
error("unexpected")
catch ex
@test typeof(ex) == RemoteException
@test typeof(ex.captured) == CapturedException
Expand Down
2 changes: 1 addition & 1 deletion test/unicode/utf32.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ for T in (UTF8String, UTF16String, UTF32String)
# Lead followed by non-continuation character > 0xbf
@test_throws UnicodeError convert(T, strval(T, UInt8[byt,0x80,0x80,0xc0]))
end
catch exp ;
catch exp
println("Error checking $T: $byt")
throw(exp)
end
Expand Down

0 comments on commit bcd744d

Please sign in to comment.