diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 16764a2146..4488ea620e 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -1394,6 +1394,7 @@ x = __ENCODING__ 1 end; assert_equal(expected, eval(code)) + assert_equal(expected, obj.arg) assert_valid_syntax(code = "#{<<~"do;"}\n#{<<~'end;'}") do; @@ -1401,6 +1402,7 @@ x = __ENCODING__ 1 end; assert_equal(expected, eval(code)) + assert_equal(expected, obj.arg) end =begin diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index b8c445c806..36731e14f9 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -1155,19 +1155,26 @@ END end end - [{a: 42}, {b: 42}].each do |i| - assert_block('newline should be insignificant after pattern label') do + bug18890 = assert_warning(/(?:.*:[47]: warning: unused literal ignored\n){2}/) do + eval("#{<<~';;;'}") + proc do |i| case i in a: - 0 - true + 0 # line 4 + a in "b": - 0 - true + 0 # line 7 + b else false end end + ;;; + end + [{a: 42}, {b: 42}].each do |i| + assert_block('newline should be significant after pattern label') do + bug18890.call(i) + end end assert_syntax_error(%q{