https://github.com/JuliaLang/julia
Raw File
Tip revision: 6683109e1cf5641cdff0a5546c4f0ec0e96ef747 authored by Shuhei Kadowaki on 10 August 2022, 07:38:21 UTC
optimizer: allow inlining of `TypeName` constant
Tip revision: 6683109
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 isabspath(path)

@test let ct = current_task()
    yieldto(@task yieldto(ct, Base.source_path()))
end === ""

@test let ct = current_task()
    yieldto(@task schedule(ct, Base.source_path()))
end === ""

@test let ct = current_task(),
    t = @task Base.source_path()
    schedule(ct)
    yieldto(t)
    fetch(t)
end === ""

@test @__FILE__() == path
back to top