Skip to content

Commit 011edf9

Browse files
committed
improve test code
1 parent 78f766b commit 011edf9

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

test/debug.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ end
520520
end
521521
# end
522522

523-
module Foo
523+
module InterpretedModuleTest
524524
using ..JuliaInterpreter
525525
function f(x)
526526
x
@@ -529,15 +529,17 @@ module Foo
529529
end
530530
end
531531
@testset "interpreted methods" begin
532-
g(x) = Foo.f(x)
533-
534-
push!(JuliaInterpreter.compiled_modules, Foo)
535-
frame = JuliaInterpreter.enter_call(g, 5)
532+
push!(JuliaInterpreter.compiled_modules, InterpretedModuleTest)
533+
frame = JuliaInterpreter.enter_call(5) do x
534+
InterpretedModuleTest.f(5)
535+
end
536536
frame, pc = JuliaInterpreter.debug_command(frame, :n)
537537
@test !(pc isa BreakpointRef)
538538

539-
push!(JuliaInterpreter.interpreted_methods, first(methods(Foo.f)))
540-
frame = JuliaInterpreter.enter_call(g, 5)
539+
push!(JuliaInterpreter.interpreted_methods, first(methods(InterpretedModuleTest.f)))
540+
frame = JuliaInterpreter.enter_call(5) do x
541+
InterpretedModuleTest.f(5)
542+
end
541543
frame, pc = JuliaInterpreter.debug_command(frame, :n)
542544
@test pc isa BreakpointRef
543545
end

test/interpret.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using JuliaInterpreter
2-
using JuliaInterpreter: enter_call_expr
32
using Test, InteractiveUtils, CodeTracking
43
using Mmap
54
using LinearAlgebra
@@ -1021,7 +1020,7 @@ let m = only(methods(_sval_func2))
10211020
delete!(JuliaInterpreter.compiled_methods, m)
10221021
end
10231022
end
1024-
let frame = Frame(@__MODULE__, only(code_lowered(sval_func2)))
1023+
let frame = JuliaInterpreter.enter_call(sval_func2)
10251024
@test 2 == JuliaInterpreter.finish_and_return!(Compiled(), frame)
10261025
end
10271026
end

0 commit comments

Comments
 (0)