Skip to content

Commit

Permalink
test for #52462
Browse files Browse the repository at this point in the history
  • Loading branch information
fatteneder committed Dec 9, 2023
1 parent 368922b commit 174f65a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1377,3 +1377,31 @@ end
end
end
end

@testset "including non-existent file throws proper error #52462" begin
mktempdir() do depot
project_path = joinpath(depot, "project")
mkpath(project_path)

# Create a `Foo.jl` package
foo_path = joinpath(depot, "dev", "Foo")
mkpath(joinpath(foo_path, "src"))
open(joinpath(foo_path, "src", "Foo.jl"); write=true) do io
println(io, """
module Foo
include("non-existant.jl")

Check warning on line 1392 in test/loading.jl

View workflow job for this annotation

GitHub Actions / Check for new typos

perhaps "existant" should be "existent".
end
""")
end
open(joinpath(foo_path, "Project.toml"); write=true) do io
println(io, """
name = "Foo"
uuid = "00000000-0000-0000-0000-000000000001"
version = "1.0.0"
""")
end

file = joinpath(depot, "dev", "non-existant.jl")

Check warning on line 1404 in test/loading.jl

View workflow job for this annotation

GitHub Actions / Check for new typos

perhaps "existant" should be "existent".
@test_throws SystemError("opening file \"$file\"") include(file)
end
end

0 comments on commit 174f65a

Please sign in to comment.