Skip to content

Commit

Permalink
use different warning tests depending on the version
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinschmidt committed Apr 19, 2018
1 parent 8da82bc commit 643bc8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
@testset "Deprecations" begin
f = @formula y ~ 1 + a*b

f2 = @test_warn "deprecated" Formula(f.lhs, f.rhs)
if VERSION > v"0.7.0-DEV"
testex = :(@test_logs (:warn, r"Formula\(lhs, rhs\) is deprecated") Formula($f.lhs, $f.rhs))
else
testex = :(@test_warn "deprecated" Formula($f.lhs, $f.rhs))
end
f2 = eval(testex)
@test f2.lhs == f.lhs
@test f2.rhs == f.rhs
@test f2.ex == f.ex
Expand Down

0 comments on commit 643bc8c

Please sign in to comment.