Skip to content

Commit 7a9c7cc

Browse files
KristofferCvtjnash
authored andcommitted
add a self loading test
1 parent 1968b14 commit 7a9c7cc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/precompile.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,4 +2363,19 @@ precompile_test_harness("MainImportDisallow") do load_path
23632363
end
23642364
end
23652365

2366+
precompile_test_harness("Package top-level load itself") do load_path
2367+
write(joinpath(load_path, "UsingSelf.jl"),
2368+
"""
2369+
__precompile__(false)
2370+
module UsingSelf
2371+
using UsingSelf
2372+
x = 3
2373+
end
2374+
""")
2375+
@eval using UsingSelf
2376+
invokelatest() do
2377+
@test UsingSelf.x == 3
2378+
end
2379+
end
2380+
23662381
finish_precompile_test!()

0 commit comments

Comments
 (0)