From 921f205ff74de7776f283f17febfffb7584392df Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Sun, 22 Oct 2023 17:37:00 +0200 Subject: [PATCH] Update ExpressionExplorer.jl --- test/ExpressionExplorer.jl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/ExpressionExplorer.jl b/test/ExpressionExplorer.jl index 6f8b9f5001..88b320f3d5 100644 --- a/test/ExpressionExplorer.jl +++ b/test/ExpressionExplorer.jl @@ -267,9 +267,14 @@ Some of these @test_broken lines are commented out to prevent printing to the te @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 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], [], [], []) + + # try catch else was introduced in 1.8 + @static if VERSION >= v"1.8.0" + @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], [], [], []) + @test testee(:(try x = 2 catch else x end), [:x], [], [], []) + end end @testset "Comprehensions" begin @test testee(:([sqrt(s) for s in 1:n]), [:n], [], [:sqrt, :(:)], [])