@@ -68,6 +68,7 @@ isdefined(Main, :Revise) ? includet("script.jl") : include("script.jl")
6868 m = first(methods(replfunc))
6969 @test whereis(m) == (" REPL[1]" , 1 )
7070 # Test with broken lookup
71+ oldlookup = CodeTracking. method_lookup_callback[]
7172 CodeTracking. method_lookup_callback[] = m -> error(" oops" )
7273 @test whereis(m) == (" REPL[1]" , 1 )
7374 # Test with definition(String, m)
@@ -81,6 +82,7 @@ isdefined(Main, :Revise) ? includet("script.jl") : include("script.jl")
8182 @test definition(String, first(methods(f))) == (fstr, 1 )
8283 pop!(hp. history)
8384 end
85+ CodeTracking. method_lookup_callback[] = oldlookup
8486
8587 m = first(methods(Test. eval))
8688 @test occursin(Sys. STDLIB, whereis(m)[1 ])
@@ -96,6 +98,20 @@ isdefined(Main, :Revise) ? includet("script.jl") : include("script.jl")
9698 lin = src. linetable[idx]
9799 file, line = whereis(lin, m)
98100 @test endswith(file, String(lin. file))
101+
102+ # Issues raised in #48
103+ m = @which(sum([1 ]; dims= 1 ))
104+ if ! isdefined(Main, :Revise)
105+ def = definition(String, m)
106+ @test def === nothing || isa(def[1 ], AbstractString)
107+ def = definition(Expr, m)
108+ @test def === nothing || isa(def, Expr)
109+ else
110+ def = definition(String, m)
111+ @test isa(def[1 ], AbstractString)
112+ def = definition(Expr, m)
113+ @test isa(def, Expr)
114+ end
99115end
100116
101117@testset " With Revise" begin
0 commit comments