Skip to content

Commit

Permalink
enrich test suite a bit more (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk authored Nov 29, 2023
1 parent 3f95258 commit 7738b80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
version:
- '1.6' # current LTS
- '1' # latest stable
- '1.10-nightly' # next stable
- 'nightly'
os:
- ubuntu-latest
Expand Down
13 changes: 7 additions & 6 deletions test/codeedges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ module ModSelective end
y2 = 7
a2 = 2
end
a2
end
frame = Frame(ModSelective, ex)
src = frame.framecode.src
edges = CodeEdges(src)
isrequired = lines_required(:a2, src, edges)
selective_eval_fromstart!(frame, isrequired)
selective_eval_fromstart!(frame, isrequired, #=istoplevel=#true)
Core.eval(ModEval, ex)
@test ModSelective.a2 === ModEval.a2 == 1
@test allmissing(ModSelective, (:z2, :x2, :y2))
Expand Down Expand Up @@ -294,7 +295,7 @@ module ModSelective end
# https://github.com/timholy/Revise.jl/issues/538
thk = Meta.lower(ModEval, quote
try
global function v1(x::Float32)
global function revise538(x::Float32)
println("F32")
end
catch e
Expand All @@ -303,9 +304,9 @@ module ModSelective end
end)
src = thk.args[1]
edges = CodeEdges(src)
lr = lines_required(:v1, src, edges)
idx = findfirst(stmt->Meta.isexpr(stmt, :leave), src.code)
@test lr[idx]
lr = lines_required(:revise538, src, edges)
selective_eval_fromstart!(Frame(ModEval, src), lr, #=istoplevel=#true)
@test isdefined(ModEval, :revise538) && length(methods(ModEval.revise538, (Float32,))) == 1

# https://github.com/timholy/Revise.jl/issues/599
thk = Meta.lower(Main, quote
Expand Down Expand Up @@ -426,7 +427,7 @@ end

isrq = lines_required!(istypedef.(stmts), src, edges)
frame = Frame(m, src)
selective_eval_fromstart!(frame, isrq, #= toplevel =# true)
selective_eval_fromstart!(frame, isrq, #=toplevel=#true)

for def in defs; @test isdefined(m, def); end
for undef in undefs; @test !isdefined(m, undef); end
Expand Down

0 comments on commit 7738b80

Please sign in to comment.