Skip to content

Commit

Permalink
Increase base/loading.jl coverage (#48629)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Feb 10, 2023
1 parent a44b576 commit 05b99af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ thefname = "the fname!//\\&\1*"
include_string_test_func = include_string(@__MODULE__, "include_string_test() = @__FILE__", thefname)
@test include_string_test_func() == thefname
@test include_string(@__MODULE__, "Base.source_path()", thefname) == Base.source_path()
@test isdir(Base.source_dir())
@test basename(@__FILE__) == "loading.jl"
@test isabspath(@__FILE__)

Expand Down Expand Up @@ -982,6 +983,8 @@ end
# Package in manifest in current env not present in depot
@test Base.locate_package(pkg) !== nothing

@test Base.find_package("Baz") !== nothing # coverage

pushfirst!(LOAD_PATH, joinpath(tmp, "Env1"))

@test Base.locate_package(pkg) === nothing
Expand Down Expand Up @@ -1083,6 +1086,17 @@ end
cmd = `$julia $(pkgimage(P)) $(opt_level(O)) $(debug_level(D)) $(check_bounds(C)) $(inline(I)) -e $script`
@test success(pipeline(cmd; stdout, stderr))
end

cf = Base.CacheFlags(255)
@test cf.use_pkgimages
@test cf.debug_level == 3
@test cf.check_bounds == 3
@test cf.inline
@test cf.opt_level == 3

io = PipeBuffer()
show(io, cf)
@test read(io, String) == "use_pkgimages = true, debug_level = 3, check_bounds = 3, inline = true, opt_level = 3"
end

empty!(Base.DEPOT_PATH)
Expand Down

0 comments on commit 05b99af

Please sign in to comment.