From a402b18c4e64f8c8cdc9a287ee53c727370d9a1b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 15 Aug 2024 09:22:03 -0400 Subject: [PATCH] [PRISM] test_syntax_check assertion updates for prism --- test/ruby/test_rubyoptions.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 40cbfd906d..d19ba391f0 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -395,16 +395,16 @@ class TestRubyOptions < Test::Unit::TestCase def test_syntax_check assert_in_out_err(%w(-cw -e a=1+1 -e !a), "", ["Syntax OK"], []) - assert_in_out_err(%w(-cw -e break), "", [], ["-e:1: Invalid break", :*]) - assert_in_out_err(%w(-cw -e next), "", [], ["-e:1: Invalid next", :*]) - assert_in_out_err(%w(-cw -e redo), "", [], ["-e:1: Invalid redo", :*]) - assert_in_out_err(%w(-cw -e retry), "", [], ["-e:1: Invalid retry", :*]) - assert_in_out_err(%w(-cw -e yield), "", [], ["-e:1: Invalid yield", :*]) - assert_in_out_err(%w(-cw -e begin -e break -e end), "", [], ["-e:2: Invalid break", :*]) - assert_in_out_err(%w(-cw -e begin -e next -e end), "", [], ["-e:2: Invalid next", :*]) - assert_in_out_err(%w(-cw -e begin -e redo -e end), "", [], ["-e:2: Invalid redo", :*]) - assert_in_out_err(%w(-cw -e begin -e retry -e end), "", [], ["-e:2: Invalid retry", :*]) - assert_in_out_err(%w(-cw -e begin -e yield -e end), "", [], ["-e:2: Invalid yield", :*]) + assert_in_out_err(%w(-cw -e break), "", [], [:*, /(-e:1:|~) Invalid break/, :*]) + assert_in_out_err(%w(-cw -e next), "", [], [:*, /(-e:1:|~) Invalid next/, :*]) + assert_in_out_err(%w(-cw -e redo), "", [], [:*, /(-e:1:|~) Invalid redo/, :*]) + assert_in_out_err(%w(-cw -e retry), "", [], [:*, /(-e:1:|~) Invalid retry/, :*]) + assert_in_out_err(%w(-cw -e yield), "", [], [:*, /(-e:1:|~) Invalid yield/, :*]) + assert_in_out_err(%w(-cw -e begin -e break -e end), "", [], [:*, /(-e:2:|~) Invalid break/, :*]) + assert_in_out_err(%w(-cw -e begin -e next -e end), "", [], [:*, /(-e:2:|~) Invalid next/, :*]) + assert_in_out_err(%w(-cw -e begin -e redo -e end), "", [], [:*, /(-e:2:|~) Invalid redo/, :*]) + assert_in_out_err(%w(-cw -e begin -e retry -e end), "", [], [:*, /(-e:2:|~) Invalid retry/, :*]) + assert_in_out_err(%w(-cw -e begin -e yield -e end), "", [], [:*, /(-e:2:|~) Invalid yield/, :*]) assert_in_out_err(%w(-cw -e !defined?(break)), "", ["Syntax OK"], []) assert_in_out_err(%w(-cw -e !defined?(next)), "", ["Syntax OK"], []) assert_in_out_err(%w(-cw -e !defined?(redo)), "", ["Syntax OK"], [])