Skip to content

Commit cf4ab83

Browse files
REPL: fix test that fails locally via Pkg.test (#57202)
Via `Base.runtests` it seems stdlibs are generally available in test environments. In `Pkg.test` they must be in the test env, which Profile isn't, so this failed locally. All REPL tests pass locally with this.
1 parent 3e08cb1 commit cf4ab83

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

stdlib/REPL/test/docview.jl

+16-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,22 @@ end
2929
end
3030

3131
@testset "non-loaded packages in doc search" begin
32-
str = get_help_io("Profile")
33-
@test occursin("Couldn't find Profile, but a loadable package with that name exists.", str)
32+
temp_package = mktempdir()
33+
write(joinpath(temp_package, "Project.toml"),
34+
"""
35+
name = "FooPackage"
36+
uuid = "2e6e0b2d-0e7f-4b7f-9f3b-6f3f3f3f3f3f"
37+
""")
38+
mkpath(joinpath(temp_package, "src"))
39+
write(joinpath(temp_package, "src", "FooPackage.jl"),
40+
"""
41+
module FooPackage
42+
end
43+
""")
44+
push!(LOAD_PATH, temp_package)
45+
str = get_help_io("FooPackage")
46+
@test occursin("Couldn't find FooPackage, but a loadable package with that name exists.", str)
47+
@test pop!(LOAD_PATH) == temp_package
3448
end
3549

3650
@testset "Check @var_str also completes to var\"\" in REPL.doc_completions()" begin

0 commit comments

Comments
 (0)