File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,23 @@ function loop_radius2(n)
7
7
s
8
8
end
9
9
10
+ tmppath = " "
11
+ if isdefined (Main, :Revise )
12
+ global tmppath
13
+ tmppath, io = mktemp ()
14
+ print (io, """
15
+ function jikwfunc(x, y=0; z="hello")
16
+ a = x + y
17
+ b = z^a
18
+ return length(b)
19
+ end
20
+ """ )
21
+ close (io)
22
+ includet (tmppath)
23
+ end
24
+
25
+ using JuliaInterpreter, Test
26
+
10
27
@testset " Breakpoints" begin
11
28
breakpoint (radius2)
12
29
stack = JuliaStackFrame[]
78
95
frame = JuliaInterpreter. enter_call (loop_radius2, 2 )
79
96
ret = @interpret JuliaInterpreter. locals (frame)
80
97
@test isa (bp, JuliaInterpreter. BreakpointRef)
98
+ # Test kwarg method
99
+ bp = breakpoint (tmppath, 3 )
100
+ stack, bp2 = @interpret jikwfunc (2 )
101
+ @test bp2 == bp
102
+ var = JuliaInterpreter. locals (stack[end ])
103
+ @test ! any (v-> v. name == :b , var)
104
+ @test filter (v-> v. name == :a , var)[1 ]. value == 2
81
105
end
82
106
83
107
# Direct return
136
160
show (io, bp)
137
161
@test String (take! (io)) == " breakpoint(loop_radius2(n) in $(@__MODULE__ ) at $(@__FILE__ ) :3, 3, ArgumentError(\" whoops\" ))"
138
162
end
163
+
164
+ if tmppath != " "
165
+ rm (tmppath)
166
+ end
You can’t perform that action at this time.
0 commit comments