@@ -1873,7 +1873,7 @@ module M58272_to end
18731873
18741874@testset " Portable scripts" begin
18751875 # Test with line-by-line comment syntax and path dependencies
1876- portable_script = joinpath (@__DIR__ , " project" , " portable_script.jl" )
1876+ portable_script = joinpath (@__DIR__ , " project" , " portable " , " portable_script.jl" )
18771877 output = read (` $(Base. julia_cmd ()) --startup-file=no $portable_script ` , String)
18781878
18791879 @test occursin (" Active project: $portable_script " , output)
@@ -1886,9 +1886,9 @@ module M58272_to end
18861886 @test occursin (" Pass" , output)
18871887
18881888 # Test with custom manifest= entry in project section
1889- portable_script_cm = joinpath (@__DIR__ , " project" , " portable_script_custom_manifest.jl" )
1889+ portable_script_cm = joinpath (@__DIR__ , " project" , " portable " , " portable_script_custom_manifest.jl" )
18901890 output_cm = read (` $(Base. julia_cmd ()) --startup-file=no $portable_script_cm ` , String)
1891- expected_cm = joinpath (@__DIR__ , " project" , " portable_script_custom.toml" )
1891+ expected_cm = joinpath (@__DIR__ , " project" , " portable " , " portable_script_custom.toml" )
18921892
18931893 @test occursin (" Active project: $portable_script_cm " , output_cm)
18941894 @test occursin (" Active manifest: $expected_cm " , output_cm)
@@ -1904,7 +1904,7 @@ module M58272_to end
19041904 @test occursin (" ✓ Random (stdlib) loaded successfully" , output_script)
19051905
19061906 # Test that regular Julia files (without inline sections) work fine as projects
1907- regular_script = joinpath (@__DIR__ , " project" , " regular_script.jl" )
1907+ regular_script = joinpath (@__DIR__ , " project" , " portable " , " regular_script.jl" )
19081908
19091909 # Running the script with --project= should set it as active project
19101910 output = read (` $(Base. julia_cmd ()) --startup-file=no --project=$regular_script $regular_script ` , String)
@@ -1918,29 +1918,35 @@ module M58272_to end
19181918 @test occursin (" Hello from regular script" , output)
19191919 @test occursin (" x = 42" , output)
19201920
1921+ portable_script_missing = joinpath (@__DIR__ , " project" , " portable" , " portable_script_missing_dep.jl" )
1922+ err_output = IOBuffer ()
1923+ result = run (pipeline (ignorestatus (` $(Base. julia_cmd ()) --startup-file=no $portable_script_missing ` ), stderr = err_output))
1924+ @test ! success (result)
1925+ @test occursin (" Package Rot13 not found in current path" , String (take! (err_output)))
1926+
19211927 # Test 1: Project section not first (has code before it)
1922- invalid_project_not_first = joinpath (@__DIR__ , " project" , " invalid_project_not_first.jl" )
1928+ invalid_project_not_first = joinpath (@__DIR__ , " project" , " portable " , " invalid_project_not_first.jl" )
19231929 err_output = IOBuffer ()
19241930 result = run (pipeline (ignorestatus (` $(Base. julia_cmd ()) --startup-file=no $invalid_project_not_first ` ), stderr = err_output))
19251931 @test ! success (result)
19261932 @test occursin (" #!project section must come first" , String (take! (err_output)))
19271933
19281934 # Test 2: Manifest section not last (has code after it)
1929- invalid_manifest_not_last = joinpath (@__DIR__ , " project" , " invalid_manifest_not_last.jl" )
1935+ invalid_manifest_not_last = joinpath (@__DIR__ , " project" , " portable " , " invalid_manifest_not_last.jl" )
19301936 err_output = IOBuffer ()
19311937 result = run (pipeline (ignorestatus (` $(Base. julia_cmd ()) --startup-file=no $invalid_manifest_not_last ` ), stderr = err_output))
19321938 @test ! success (result)
19331939 @test occursin (" #!manifest section must come last" , String (take! (err_output)))
19341940
19351941 # Test 3: Project not first, but manifest present
1936- invalid_both = joinpath (@__DIR__ , " project" , " invalid_both.jl" )
1942+ invalid_both = joinpath (@__DIR__ , " project" , " portable " , " invalid_both.jl" )
19371943 err_output = IOBuffer ()
19381944 result = run (pipeline (ignorestatus (` $(Base. julia_cmd ()) --startup-file=no --project=$invalid_both -e "using Test"` ), stderr = err_output))
19391945 @test ! success (result)
19401946 @test occursin (" #!project section must come first" , String (take! (err_output)))
19411947
19421948 # Test 4: Manifest with code in between sections
1943- invalid_code_between = joinpath (@__DIR__ , " project" , " invalid_code_between.jl" )
1949+ invalid_code_between = joinpath (@__DIR__ , " project" , " portable " , " invalid_code_between.jl" )
19441950 err_output = IOBuffer ()
19451951 result = run (pipeline (ignorestatus (` $(Base. julia_cmd ()) --startup-file=no --project=$invalid_code_between -e "using Test"` ), stderr = err_output))
19461952 @test ! success (result)
0 commit comments