From dcee3ecb35d5d504494dacd153848264612a62ee Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Sat, 6 Jan 2024 13:10:41 -0600 Subject: [PATCH] Add test for #718 --- test/runtests.jl | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 3f743209..32a5a429 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1635,6 +1635,45 @@ const issue639report = [] pop!(LOAD_PATH) end + do_test("Submodule in same file (#718)") && @testset "Submodule in same file (#718)" begin + testdir = newtestdir() + dn = joinpath(testdir, "TestPkg718", "src") + mkpath(dn) + write(joinpath(dn, "TestPkg718.jl"), """ + module TestPkg718 + + module TestModule718 + export _VARIABLE_UNASSIGNED + #=global=# _VARIABLE_UNASSIGNED = -84.0 + end + + using .TestModule718 + + end + """) + sleep(mtimedelay) + @eval using TestPkg718 + sleep(mtimedelay) + @test TestPkg718._VARIABLE_UNASSIGNED == -84.0 + write(joinpath(dn, "TestPkg718.jl"), """ + module TestPkg718 + + module TestModule718 + export _VARIABLE_UNASSIGNED + #=global=# _VARIABLE_UNASSIGNED = -83.0 + end + + using .TestModule718 + + end + """) + yry() + @test TestPkg718._VARIABLE_UNASSIGNED == -83.0 + + rm_precompile("TestPkg718") + pop!(LOAD_PATH) + end + do_test("Timing (issue #341)") && @testset "Timing (issue #341)" begin testdir = newtestdir() dn = joinpath(testdir, "Timing", "src")