Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
fatteneder committed Feb 25, 2024
1 parent 36b08e7 commit 959f6b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ end
exc = try; include("./notarealfile.jl"); "unexpectedly reached!"; catch exc; exc; end
@test exc isa ArgumentError
exc.msg
end == "$(repr(joinpath(@__DIR__, "notarealfile.jl"))): No such file or directory"
end == "including $(repr(joinpath(@__DIR__, "notarealfile.jl"))): No such file"

old_act_proj = Base.ACTIVE_PROJECT[]
pushfirst!(LOAD_PATH, "@")
Expand Down Expand Up @@ -1542,19 +1542,19 @@ end
end

file = joinpath(depot, "dev", "non-existent.jl")
@test_throws ArgumentError("$(repr(file)): No such file or directory") include(file)
@test_throws ArgumentError("including $(repr(file)): No such file") include(file)
touch(file)
@test include_dependency(file) === nothing
chmod(file, 0x000)
@test_throws ArgumentError("$(repr(file)): Missing read permission") include_dependency(file)
@test_throws ArgumentError("including $(repr(file)): Missing read permission") include_dependency(file)

# same for include_dependency: #52063
dir = mktempdir() do dir
@test include_dependency(dir) === nothing
chmod(dir, 0x000)
@test_throws ArgumentError("$(repr(dir)): Missing read permission") include_dependency(dir)
@test_throws ArgumentError("including $(repr(dir)): Missing read permission") include_dependency(dir)
dir
end
@test_throws ArgumentError("$(repr(dir)): No such file or directory") include_dependency(dir)
@test_throws ArgumentError("including $(repr(dir)): No such file or directory") include_dependency(dir)
end
end

0 comments on commit 959f6b1

Please sign in to comment.