summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-06-11 14:01:29 -0400
committerGitHub <noreply@github.com>2024-06-11 11:01:29 -0700
commit4c50d23245689761e04db450ced9fe9fa76997d0 (patch)
treece372b2b6c65651e7bdee240912ce04baa8c07d6 /test
parent40251ed0dfe99bb09c2fa542fce603ade25e3729 (diff)
Raise SyntaxError on invalid encoding symbol (#10967)
[Bug #20280] Backport of #10014.
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb4
1 files changed, 4 insertions, 0 deletions
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