From 808c2a637c1a195bf90b5c763ffcc58b884f4be5 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 7 Jun 2024 14:58:12 +0200 Subject: [PATCH] squash me --- test/runtests.jl | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 925b411..d0173d8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -360,22 +360,24 @@ end @test format_string( "try\n$(sp)x\n$(sp)finally\n$(sp)y\n$(sp)catch err\n$(sp)z\n$(sp)end", ) == "try\n x\nfinally\n y\ncatch err\n z\nend" - # try-catch-else-end - @test format_string( - "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end", - ) == "try\n x\ncatch\n y\nelse\n z\nend" - # try-catch(err)-else-end - @test format_string( - "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end", - ) == "try\n x\ncatch err\n y\nelse\n z\nend" - # try-catch-else-finally-end - @test format_string( - "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end", - ) == "try\n x\ncatch\n y\nelse\n z\nfinally\n z\nend" - # try-catch(err)-else-finally-end - @test format_string( - "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end", - ) == "try\n x\ncatch err\n y\nelse\n z\nfinally\n z\nend" + if VERSION >= v"1.8" + # try-catch-else-end + @test format_string( + "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end", + ) == "try\n x\ncatch\n y\nelse\n z\nend" + # try-catch(err)-else-end + @test format_string( + "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end", + ) == "try\n x\ncatch err\n y\nelse\n z\nend" + # try-catch-else-finally-end + @test format_string( + "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end", + ) == "try\n x\ncatch\n y\nelse\n z\nfinally\n z\nend" + # try-catch(err)-else-finally-end + @test format_string( + "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end", + ) == "try\n x\ncatch err\n y\nelse\n z\nfinally\n z\nend" + end # do-end @test format_string("open() do\n$(sp)a\n$(sp)end") == "open() do\n a\nend" @test format_string("open() do io\n$(sp)a\n$(sp)end") == "open() do io\n a\nend"