Skip to content

Commit

Permalink
loading: test project & manifest import modules structure
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Jan 16, 2018
1 parent 28782a6 commit 1c499c7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,42 @@ push!(LOAD_PATH, "project")
end
end

@testset "project & manifest import" begin
@test !@isdefined Foo
@test !@isdefined Bar
import Foo
@test @isdefined Foo
@test !@isdefined Bar
import Bar
@test @isdefined Foo
@test @isdefined Bar

@testset "module graph structure" begin
local classes = Dict(
"Foo1" => [Foo],
"Bar" => [Bar, Foo.Bar],
"Baz" => [Foo.Baz, Bar.Baz, Foo.Bar.Baz],
"Foo2" => [Bar.Foo, Foo.Bar.Foo, Foo.Baz.Foo, Bar.Baz.Foo],
"Qux" => [Foo.Qux, Foo.Baz.Qux, Bar.Baz.Qux, Foo.Bar.Foo.Qux,
Bar.Foo.Qux, Foo.Baz.Foo.Qux, Bar.Baz.Foo.Qux,
Foo.Bar.Baz.Foo.Qux],
)
for (i, (this, mods)) in enumerate(classes)
for x in mods
@test x.this == this
for y in mods
@test x === y
end
for (j, (that, mods′)) in enumerate(classes)
i == j && continue
for z in mods′
@test x !== z
end
end
end
end
end
end

empty!(LOAD_PATH)
append!(LOAD_PATH, saved_load_path)

0 comments on commit 1c499c7

Please sign in to comment.