File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1858,6 +1858,38 @@ precompile_test_harness("Issue #50538") do load_path
1858
1858
@test ! isdefined (I50538, :undefglobal )
1859
1859
end
1860
1860
1861
+ # check that precompilation workload restores initial state of DEPOT_PATH etc.
1862
+ precompile_test_harness (" check DEPOT_PATH etc are restored" ) do load_path
1863
+ write (joinpath (load_path, " modify_depot_path.jl" ),
1864
+ """
1865
+ module Modify_DEPOT_PATH
1866
+ empty!(DEPOT_PATH)
1867
+ end
1868
+ """ )
1869
+ @test Base. compilecache (Base. PkgId (" Modify_DEPOT_PATH" )) isa ErrorException
1870
+ write (joinpath (load_path, " modify_load_path.jl" ),
1871
+ """
1872
+ module Modify_LOAD_PATH
1873
+ empty!(LOAD_PATH)
1874
+ end
1875
+ """ )
1876
+ @test Base. compilecache (Base. PkgId (" Modify_LOAD_PATH" )) isa ErrorException
1877
+ write (joinpath (load_path, " modify_env.jl" ),
1878
+ """
1879
+ module Modify_ENV
1880
+ ENV["modify_ENV"] = true
1881
+ end
1882
+ """ )
1883
+ @test Base. compilecache (Base. PkgId (" Modify_ENV" )) isa ErrorException
1884
+ write (joinpath (load_path, " modify_active_project.jl" ),
1885
+ """
1886
+ module Modify_active_project
1887
+ Base.set_active_project!(mktempdir())
1888
+ end
1889
+ """ )
1890
+ @test Base. compilecache (Base. PkgId (" Modify_active_project" )) isa ErrorException
1891
+ end
1892
+
1861
1893
empty! (Base. DEPOT_PATH )
1862
1894
append! (Base. DEPOT_PATH , original_depot_path)
1863
1895
empty! (Base. LOAD_PATH )
You can’t perform that action at this time.
0 commit comments