Skip to content

Commit 42eb383

Browse files
committed
unit test for issue 55340
1 parent e8466e9 commit 42eb383

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

test/relocatedepot.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,28 @@ if !test_relocated_depot
4343
if isdirpath(DEPOT_PATH[1])
4444
DEPOT_PATH[1] = dirname(DEPOT_PATH[1]) # strip trailing pathsep
4545
end
46-
tag = joinpath("@depot", "") # append a pathsep
46+
tag = string("@depot", Base.Filesystem.pathsep())
4747
@test startswith(Base.replace_depot_path(path), tag)
48-
DEPOT_PATH[1] = joinpath(DEPOT_PATH[1], "") # append a pathsep
48+
DEPOT_PATH[1] = string(DEPOT_PATH[1], Base.Filesystem.pathsep())
4949
@test startswith(Base.replace_depot_path(path), tag)
5050
popfirst!(DEPOT_PATH)
5151
@test !startswith(Base.replace_depot_path(path), tag)
5252
end
5353
end
5454

55+
# 55340
56+
test_harness(empty_depot_path=true) do
57+
mktempdir() do dir
58+
jlrc = joinpath(dir, "julia-rc2")
59+
jl = joinpath(dir, "julia")
60+
mkdir(jlrc)
61+
push!(DEPOT_PATH, jlrc)
62+
@test Base.replace_depot_path(jlrc) == "@depot"
63+
@test Base.replace_depot_path(jl) != "@depot-rc2"
64+
@test Base.replace_depot_path(jl) == jl
65+
end
66+
end
67+
5568
end
5669

5770
@testset "restore path from @depot tag" begin

0 commit comments

Comments
 (0)