File tree 1 file changed +22
-0
lines changed 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1836,3 +1836,25 @@ end
1836
1836
@test_broken isempty (undoc)
1837
1837
@test undoc == [:AbstractREPL , :BasicREPL , :LineEditREPL , :StreamREPL ]
1838
1838
end
1839
+
1840
+ @testset " Dummy Pkg prompt" begin
1841
+ # do this in an empty depot to test default for new users
1842
+ withenv (" JULIA_DEPOT_PATH" => mktempdir (), " JULIA_LOAD_PATH" => nothing ) do
1843
+ prompt = readchomp (` $(Base. julia_cmd ()[1 ]) --startup-file=no -e "using REPL; print(REPL.Pkg_promptf())"` )
1844
+ @test prompt == " (@v$(VERSION . major) .$(VERSION . minor) ) pkg> "
1845
+ end
1846
+
1847
+ get_prompt (proj:: String ) = readchomp (` $(Base. julia_cmd ()[1 ]) --startup-file=no $(proj) -e "using REPL; print(REPL.Pkg_promptf())"` )
1848
+
1849
+ @test get_prompt (" --project=$(pkgdir (REPL)) " ) == " (REPL) pkg> "
1850
+
1851
+ tdir = mkpath (joinpath (mktempdir (), " foo" ))
1852
+ @test get_prompt (" --project=$tdir " ) == " (foo) pkg> "
1853
+
1854
+ proj_file = joinpath (tdir, " Project.toml" )
1855
+ touch (proj_file) # make a bad Project.toml
1856
+ @test get_prompt (" --project=$proj_file " ) == " (foo) pkg> "
1857
+
1858
+ write (proj_file, " name = \" Bar\"\n " )
1859
+ @test get_prompt (" --project=$proj_file " ) == " (Bar) pkg> "
1860
+ end
You can’t perform that action at this time.
0 commit comments