Skip to content

Commit

Permalink
Merge pull request #20017 from JuliaLang/yyc/tests/nowarn
Browse files Browse the repository at this point in the history
Fix at-test_nowarn
  • Loading branch information
StefanKarpinski committed Jan 13, 2017
2 parents dd6ceff + 7d9264c commit aa2ea55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Test whether evaluating `expr` results in empty [`STDERR`](@ref) output
"""
macro test_nowarn(expr)
quote
@test_warn r"^(?!.)"s $expr
@test_warn r"^(?!.)"s $(esc(expr))
end
end

Expand Down
8 changes: 8 additions & 0 deletions test/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
# Test @test_warn
@test 1234 === @test_nowarn(1234)
@test 5678 === @test_warn("WARNING: foo", begin warn("foo"); 5678; end)
let a
# Broken
# @test_throws UndefVarError a
# Replace with the previous line when #20016 is fixed
@test_throws UndefRefError a
@test_nowarn a = 1
@test a === 1
end

a = Array(Float64, 2, 2, 2, 2, 2)
a[1,1,1,1,1] = 10
Expand Down

0 comments on commit aa2ea55

Please sign in to comment.