From 05a85a32f3d244ec518b9b6b24ab36ab81beb850 Mon Sep 17 00:00:00 2001 From: Oliver Schulz Date: Mon, 15 Mar 2021 20:44:33 +0100 Subject: [PATCH] Improve tests for --project and JULIA_PROJECT --- test/cmdlineargs.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 51bba3f6534531..01ee20d42d889b 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 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