Skip to content

Commit eb8aa80

Browse files
committed
Use abspath on filenames (fixes #23)
1 parent 32b620c commit eb8aa80

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/CodeTracking.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ Return the signatures of all methods whose definition spans the specified locati
114114
Returns `nothing` if there are no methods at that location.
115115
"""
116116
function signatures_at(filename::AbstractString, line::Integer)
117+
filename = abspath(filename)
117118
if occursin(juliabase, filename)
118119
rpath = postpath(filename, juliabase)
119120
id = PkgId(Base)

test/runtests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using CodeTracking
44
using Test, InteractiveUtils
55
# Note: ColorTypes needs to be installed, but note the intentional absence of `using ColorTypes`
66

7-
include("script.jl")
7+
isdefined(Main, :Revise) ? includet("script.jl") : include("script.jl")
88

99
@testset "CodeTracking.jl" begin
1010
m = first(methods(f1))
@@ -87,5 +87,8 @@ end
8787
@test !isempty(sigs)
8888
sigs = signatures_at(Base.find_source_file(String(m.file)), m.line)
8989
@test !isempty(sigs)
90+
91+
# issue #23
92+
@test !isempty(signatures_at("script.jl", 9))
9093
end
9194
end

0 commit comments

Comments
 (0)