https://github.com/JuliaLang/julia
Raw File
Tip revision: d386e40c17d43b79fc89d3e579fc04547241787c authored by Alex Arslan on 13 December 2017, 18:08:26 UTC
Tag version v0.6.2 (#24993)
Tip revision: d386e40
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)
    wait(t)
end == path
@test isabspath(@__FILE__)
back to top