Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ jobs:
TERM="xterm" julia --project -i --code-coverage -e '
using InteractiveUtils, REPL, Revise, Pkg
Pkg.add("ColorTypes")
# @async(Base.run_main_repl(true, true, false, true, false))
@async(Base.run_main_repl(true, true, false, true, false))
sleep(2)
cd("test")
include("runtests.jl")
REPL.eval_user_input(:(exit()), Base.active_repl_backend)
if Base.VERSION.major == 1 && Base.VERSION.minor >= 9
REPL.eval_user_input(:(exit()), Base.active_repl_backend, Main)
else
REPL.eval_user_input(:(exit()), Base.active_repl_backend)
end
'
- uses: julia-actions/julia-processcoverage@latest
- uses: codecov/codecov-action@v3
Expand Down
1 change: 1 addition & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ checkname(fname::Symbol, name::Symbol) = begin
fname === name && return true
startswith(string(name), string('#', fname, '#')) && return true
string(name) == string(fname, "##kw") && return true
match(r"^#\d+$", string(name)) !== nothing && return true # support `f = x -> 2x`
return false
end
checkname(fname::Symbol, ::Nothing) = true
Expand Down
8 changes: 7 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j
eval(ex)
@test code_string(f_no_linenum, (Int,)) === nothing

# Issue #80
m = only(methods(f80))
src, line = definition(String, m)
@test occursin("x^3", src)
@test line == 52

# Invalidation-insulating methods used by Revise and perhaps others
d = IdDict{Union{String,Symbol},Union{Function,Vector{Function}}}()
CodeTracking.invoked_setindex!(d, sin, "sin")
Expand Down Expand Up @@ -286,7 +292,7 @@ struct Functor end
@test body == "(::Functor)(x, y) = x+y"
end

if v"1.6" <= VERSION < v"1.9"
if v"1.6" <= VERSION < v"1.9-beta"
@testset "kwfuncs" begin
body, _ = CodeTracking.definition(String, @which fkw(; x=1))
@test body == """
Expand Down
3 changes: 3 additions & 0 deletions test/script.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ end
function fkw(; x=1)
x
end

# Issue #80
f80 = x -> 2 * x^3 + 1