Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Oct 4, 2024
1 parent 358bc55 commit 1cda556
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions stdlib/REPL/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,15 @@ end
@test prompt == "(@v$(VERSION.major).$(VERSION.minor)) pkg> "
end

# Issue 55850
tmp_55850 = mktempdir()
tmp_sym_link = joinpath(tmp_55850, "sym")
symlink(tmp_55850, tmp_sym_link; dir_target=true)
withenv("JULIA_DEPOT_PATH" => tmp_sym_link, "JULIA_LOAD_PATH" => nothing) do
prompt = readchomp(`$(Base.julia_cmd()[1]) --startup-file=no -e "using REPL; print(REPL.projname(REPL.find_project_file()))"`)
@test prompt == "@v$(VERSION.major).$(VERSION.minor)"
end

get_prompt(proj::String) = readchomp(`$(Base.julia_cmd()[1]) --startup-file=no $(proj) -e "using REPL; print(REPL.Pkg_promptf())"`)

@test get_prompt("--project=$(pkgdir(REPL))") == "(REPL) pkg> "
Expand Down

0 comments on commit 1cda556

Please sign in to comment.