Skip to content

Commit 1c499c7

Browse files
loading: test project & manifest import modules structure
1 parent 28782a6 commit 1c499c7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/loading.jl

+37
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,42 @@ push!(LOAD_PATH, "project")
134134
end
135135
end
136136

137+
@testset "project & manifest import" begin
138+
@test !@isdefined Foo
139+
@test !@isdefined Bar
140+
import Foo
141+
@test @isdefined Foo
142+
@test !@isdefined Bar
143+
import Bar
144+
@test @isdefined Foo
145+
@test @isdefined Bar
146+
147+
@testset "module graph structure" begin
148+
local classes = Dict(
149+
"Foo1" => [Foo],
150+
"Bar" => [Bar, Foo.Bar],
151+
"Baz" => [Foo.Baz, Bar.Baz, Foo.Bar.Baz],
152+
"Foo2" => [Bar.Foo, Foo.Bar.Foo, Foo.Baz.Foo, Bar.Baz.Foo],
153+
"Qux" => [Foo.Qux, Foo.Baz.Qux, Bar.Baz.Qux, Foo.Bar.Foo.Qux,
154+
Bar.Foo.Qux, Foo.Baz.Foo.Qux, Bar.Baz.Foo.Qux,
155+
Foo.Bar.Baz.Foo.Qux],
156+
)
157+
for (i, (this, mods)) in enumerate(classes)
158+
for x in mods
159+
@test x.this == this
160+
for y in mods
161+
@test x === y
162+
end
163+
for (j, (that, mods′)) in enumerate(classes)
164+
i == j && continue
165+
for z in mods′
166+
@test x !== z
167+
end
168+
end
169+
end
170+
end
171+
end
172+
end
173+
137174
empty!(LOAD_PATH)
138175
append!(LOAD_PATH, saved_load_path)

0 commit comments

Comments
 (0)