/
githubmirror
/
julia
Обзор
Документация
Войти
/
githubmirror
/
julia
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
JuliaLowering/test/modules.jl
50 строк
1 KB
Em Chu
[JuliaLowering] Many declaration/assignment tests, minor bugfixes (#61213)
17 мар 2026, 20:00
Не верифицирован
17 мар 2026, 20:00
942c262
Код
Авторство
О чём код?
test_mod = Module() A = JuliaLowering.include_string(test_mod, """ module A function g() return "hi" end end """, "module_test") @test A isa Module @test A.g() == "hi" @test A.include isa Base.IncludeInto @test A.eval isa Core.EvalInto @test A.Base === Base @test A.eval(:(x = -2)) == -2 @test A.x == -2 B = JuliaLowering.include_string(test_mod, """ baremodule B end """, "baremodule_test") @test B.Core === Core @test !isdefined(B, :include) @test !isdefined(B, :eval) @test !isdefined(B, :Base) # Module init order Amod = JuliaLowering.include_string(test_mod, """ module A init_order = [] __init__() = push!(init_order, "A") module B using ..A __init__() = push!(A.init_order, "B") end module C using ..A __init__() = push!(A.init_order, "C") module D using ...A __init__() = push!(A.init_order, "D") end module E using ...A __init__() = push!(A.init_order, "E") end end end """) @test Amod.init_order == ["B", "D", "E", "C", "A"]