https://github.com/JuliaLang/julia
Raw File
Tip revision: 0f3c7c868cf8594b689f0c251f951eb71be5c0ac authored by Jeff Bezanson on 02 October 2018, 02:59:52 UTC
make default module-prefix showing independent of the state of Main(e)
Tip revision: 0f3c7c8
test_sourcepath.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

# source path in tasks
path = Base.source_path()::String # this variable is leaked to the source script
@test endswith(path, joinpath("test","test_sourcepath.jl"))
@test let ct = current_task()
    yieldto(@task yieldto(ct, Base.source_path()))
end == path
@test let ct = current_task()
    yieldto(@task schedule(ct, Base.source_path()))
end == path
@test let ct = current_task(), t = @task Base.source_path()
    schedule(ct)
    yieldto(t)
    fetch(t)
end == path
@test isabspath(@__FILE__)
back to top