Skip to content

Commit

Permalink
Improve tests for --project and JULIA_PROJECT
Browse files Browse the repository at this point in the history
  • Loading branch information
oschulz committed Mar 15, 2021
1 parent 8800006 commit 05a85a3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,16 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`

# ~ expansion in --project and JULIA_PROJECT
if !Sys.iswindows()
expanded_a = abspath(expanduser("~/foo"))
@test occursin(expanded_a, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`))
@test occursin(expanded_a, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT" => "~/foo", "HOME" => homedir())))
let expanded = abspath(expanduser("~/foo"))
@test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`))
@test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT" => "~/foo", "HOME" => homedir())))
end
end

expanded_b = abspath(Base.load_path_expand("@foo"))
@test occursin(expanded_b, readchomp(`$exename --project='@foo' -E 'Base.active_project()'`))
@test occursin(expanded_b, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT" => "@foo", "HOME" => homedir())))
# handling of @projectname in --project and JULIA_PROJECT
let expanded = abspath(Base.load_path_expand("@foo"))
@test occursin(expanded, readchomp(`$exename --project='@foo' -E 'Base.active_project()'`))
@test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT" => "@foo", "HOME" => homedir())))
end

# --quiet, --banner
Expand Down

0 comments on commit 05a85a3

Please sign in to comment.