From ffac549f3397878fbb9bfe11900cd677468999a4 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Fri, 15 Dec 2017 14:38:02 -0600 Subject: [PATCH 1/2] Address method move --- test/patch.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/patch.jl b/test/patch.jl index 0e2a489..670de2c 100644 --- a/test/patch.jl +++ b/test/patch.jl @@ -50,12 +50,14 @@ 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(Base.MPFR.cos))) - @test p.modules == Set([:(Base.MPFR)]) + @test p.signature == :(f(t::typeof($mod.cos))) + @test p.modules == Set([:($mod)]) expected = quote - import Base.MPFR - f(t::typeof(Base.MPFR.cos)) = $(p.body)(t) + $import_mod + f(t::typeof($mod.cos)) = $(p.body)(t) end @test Mocking.convert(Expr, p) == strip_lineno!(expected) end From 410a20b16a1d6e02eeb162de75c9517b0192f996 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Fri, 15 Dec 2017 14:42:46 -0600 Subject: [PATCH 2/2] Switch to using `+` instead of `cos` for test --- test/patch.jl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/patch.jl b/test/patch.jl index 670de2c..7a313ed 100644 --- a/test/patch.jl +++ b/test/patch.jl @@ -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