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, :(:)], [])