diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 51bba3f6534531..10fd82bb57d09a 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -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 expanded == readchomp(`$exename --project='~/foo' -e 'println(dirname(Base.active_project()))'`) + @test expanded == readchomp(setenv(`$exename -e 'println(dirname(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 expanded == readchomp(`$exename --project='@foo' -e 'println(dirname(Base.active_project()))'`) + @test expanded == readchomp(setenv(`$exename -e 'println(dirname(Base.active_project()))'`, "JULIA_PROJECT" => "@foo", "HOME" => homedir())) end # --quiet, --banner