Skip to content

Commit

Permalink
Switch to using + instead of cos for test
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Dec 15, 2017
1 parent ffac549 commit 410a20b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/patch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ end
end

@testset "assertion expression" begin
mod = VERSION < v"0.7.0-DEV.2762" ? :(Base.MPFR) : :Base
import_mod = VERSION < v"0.7.0-DEV.2762" ? :(import Base.MPFR) : :(import Base)
p = @patch f(t::typeof(cos)) = nothing
@test p.signature == :(f(t::typeof($mod.cos)))
@test p.modules == Set([:($mod)])
p = @patch f(t::typeof(+)) = nothing
@test p.signature == :(f(t::typeof(Base.:+)))
@test p.modules == Set([:Base])
expected = quote
$import_mod
f(t::typeof($mod.cos)) = $(p.body)(t)
import Base
f(t::typeof(Base.:+)) = $(p.body)(t)
end
@test Mocking.convert(Expr, p) == strip_lineno!(expected)
end
Expand Down

0 comments on commit 410a20b

Please sign in to comment.