@@ -22,6 +22,9 @@ using Test
2222
2323const REPO = " https://github.com/0h7z/Exts.jl"
2424
25+ const BareModule () = Module (gensym (), false )
26+ const VoidModule () = Module (gensym (), false , false )
27+
2528@testset " Pkg" begin
2629 using Pkg: PlatformEngines, Registry, Types, is_manifest_current
2730 @test getfield .(Registry. reachable_registries (), :name ) ⊇ [" General" , " 0hjl" ]
@@ -349,20 +352,19 @@ end
349352 @test getindex .(Exts. walkdir (), 2 ) == getindex .(Base. walkdir (pwd ()), 2 )
350353 @test getindex .(Exts. walkdir (), 3 ) == getindex .(Base. walkdir (pwd ()), 3 )
351354
352- @eval begin
353- # ! format: noindent
354- @test @catch throw (true )
355- @test @try error () true
356- @test @trycatch throw (false ) !
357- @test @trycatch throw (true )
358- @test @trycatch true
359- @test ErrorException (" " ) == @catch error ()
360- @test ErrorException (" " ) == @trycatch error ()
361- @test isnothing (@catch true )
362- @test isnothing (@try error ())
363- @test S " :" === :(:)
364- @trycatch throw (true ) x -> @test x
365- end
355+ @eval VoidModule () $ Exts. @trycatch $ throw ($ true ) $ (x -> @test x)
356+ @test @eval VoidModule () $ Exts. @catch $ throw ($ true )
357+ @test @eval VoidModule () $ Exts. @try $ error () $ true
358+ @test @eval VoidModule () $ Exts. @trycatch $ throw ($ false ) $ !
359+ @test @eval VoidModule () $ Exts. @trycatch $ throw ($ true )
360+ @test @eval VoidModule () $ Exts. @trycatch $ true
361+ @test ErrorException (" " ) == @eval VoidModule () $ Exts. @catch $ error ()
362+ @test ErrorException (" " ) == @eval VoidModule () $ Exts. @trycatch $ error ()
363+ @test isnothing (@eval VoidModule () $ Exts. @catch $ true )
364+ @test isnothing (@eval VoidModule () $ Exts. @try $ error ())
365+ @test Symbol (:(:)) === @eval VoidModule () $ Exts. @S_str " :" # :(
366+ # https://github.com/JuliaLang/julia/issues/36566
367+ # v1.9 LoadError: syntax: cannot juxtapose string literal
366368
367369 @static if VERSION < v " 1.10"
368370 @test freeze (Dict ()) isa LittleDict{Bottom, Bottom}
0 commit comments