From 4c50d23245689761e04db450ced9fe9fa76997d0 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 11 Jun 2024 14:01:29 -0400 Subject: Raise SyntaxError on invalid encoding symbol (#10967) [Bug #20280] Backport of #10014. --- test/ruby/test_syntax.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index a7a25ef3c0..cc332a9412 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1354,6 +1354,10 @@ eom assert_valid_syntax 'p :foo, {proc do end => proc do end, b: proc do end}', bug13073 end + def test_invalid_encoding_symbol + assert_syntax_error('{"\xC3": 1}', "invalid symbol") + end + def test_do_after_local_variable obj = Object.new def obj.m; yield; end -- cgit v1.2.3