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