From fb19c5c1573d34da045977ff6f72bcfef23665da Mon Sep 17 00:00:00 2001 From: Florian Atteneder Date: Fri, 2 Aug 2024 23:36:32 +0200 Subject: [PATCH] unit test for issue 55340 --- test/relocatedepot.jl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/relocatedepot.jl b/test/relocatedepot.jl index 039d422c35e25d..ceb9342459366c 100644 --- a/test/relocatedepot.jl +++ b/test/relocatedepot.jl @@ -43,15 +43,28 @@ if !test_relocated_depot if isdirpath(DEPOT_PATH[1]) DEPOT_PATH[1] = dirname(DEPOT_PATH[1]) # strip trailing pathsep end - tag = joinpath("@depot", "") # append a pathsep + tag = string("@depot", Base.Filesystem.pathsep()) @test startswith(Base.replace_depot_path(path), tag) - DEPOT_PATH[1] = joinpath(DEPOT_PATH[1], "") # append a pathsep + DEPOT_PATH[1] = string(DEPOT_PATH[1], Base.Filesystem.pathsep()) @test startswith(Base.replace_depot_path(path), tag) popfirst!(DEPOT_PATH) @test !startswith(Base.replace_depot_path(path), tag) end end + # 55340 + test_harness(empty_depot_path=true) do + mktempdir() do dir + jlrc = joinpath(dir, "julia-rc2") + jl = joinpath(dir, "julia") + mkdir(jlrc) + push!(DEPOT_PATH, jlrc) + @test Base.replace_depot_path(jlrc) == "@depot" + @test Base.replace_depot_path(jl) != "@depot-extended" + @test Base.replace_depot_path(jl) == jl + end + end + end @testset "restore path from @depot tag" begin