From d12df54efdf12d010f3e311a0a0effe90793f738 Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Sun, 22 Oct 2023 16:59:01 +0200 Subject: [PATCH] Update ExpressionExplorer.jl --- test/ExpressionExplorer.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/ExpressionExplorer.jl b/test/ExpressionExplorer.jl index 6013328c8f..6f8b9f5001 100644 --- a/test/ExpressionExplorer.jl +++ b/test/ExpressionExplorer.jl @@ -260,14 +260,16 @@ Some of these @test_broken lines are commented out to prevent printing to the te @test testee(:(for k in 1:2, r in 3:4; global z = k + r; end), [], [:z], [:+, :(:)], []) @test testee(:(while k < 2; r = w; global z = k + r; end), [:k, :w], [:z], [:+, :(<)], []) end - @testset "`try` & `catch`" begin + @testset "`try` & `catch` & `else` & `finally`" begin @test testee(:(try a = b + 1 catch; end), [:b], [], [:+], []) @test testee(:(try a() catch e; e end), [], [], [:a], []) @test testee(:(try a() catch; e end), [:e], [], [:a], []) @test testee(:(try a + 1 catch a; a end), [:a], [], [:+], []) @test testee(:(try 1 catch e; e finally a end), [:a], [], [], []) @test testee(:(try 1 finally a end), [:a], [], [], []) - @test testee(:(try 1 finally a; else x = 1; x end), [:a], [], [], []) + @test testee(:(try 1 catch else x = 1; x finally a; end), [:a], [], [], []) + @test testee(:(try 1 catch else x = j; x finally a; end), [:a, :j], [], [], []) + @test testee(:(try x = 2 catch else x finally a; end), [:a, :x], [], [], []) end @testset "Comprehensions" begin @test testee(:([sqrt(s) for s in 1:n]), [:n], [], [:sqrt, :(:)], [])