Skip to content

Commit bc2968f

Browse files
committed
Allow :line Expr or LineInfoNode in generator test
1 parent b052916 commit bc2968f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/debug.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using JuliaInterpreter, Test
1+
using CodeTracking, JuliaInterpreter, Test
22
using JuliaInterpreter: enter_call, enter_call_expr, get_return, @lookup
33
using Base.Meta: isexpr
4+
include("utils.jl")
45

56
const ALL_COMMANDS = (:n, :s, :c, :finish, :nc, :se, :si, :until)
67

@@ -143,7 +144,8 @@ end
143144
frame = enter_call_expr(:($(callgenerated)()))
144145
f, pc = debug_command(frame, :sg)
145146
# Aside: generators can have `Expr(:line, ...)` in their line tables, test that this is OK
146-
@test isexpr(JuliaInterpreter.linetable(f, 2), :line)
147+
lt = JuliaInterpreter.linetable(f, 2)
148+
@test isexpr(lt, :line) || isa(lt, Core.LineInfoNode)
147149
@test isa(pc, BreakpointRef)
148150
@test JuliaInterpreter.scopeof(f).name == :generatedfoo
149151
stmt = JuliaInterpreter.pc_expr(f)

0 commit comments

Comments
 (0)