From 9bf3b1b2566f6aa9c105064ce90ba8ff05bc42d6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 19 Feb 2024 17:26:08 +0900 Subject: [PATCH] Invalid encoding symbols now raise SyntaxError in 3.4 ruby/ruby@d9b61e228ff86f00c195abb6c3e0e6f4525385e0 --- test/irb/test_context.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index 059c48676..7c4d5ffa4 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -43,6 +43,10 @@ def test_evaluate_with_encoding_error_without_lineno omit "Remove me after https://github.com/ruby/prism/issues/2129 is addressed and adopted in TruffleRuby" end + if RUBY_VERSION >= "3.4." + omit "Now raises SyntaxError" + end + assert_raise_with_message(EncodingError, /invalid symbol/) { @context.evaluate(%q[:"\xAE"], 1) # The backtrace of this invalid encoding hash doesn't contain lineno.