diff options
author | Jeremy Evans <code@jeremyevans.net> | 2023-03-24 11:53:53 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2023-04-23 19:27:58 -0700 |
commit | a8ba1ddd78544b4bda749051d44f7b2a8a0ec5ff (patch) | |
tree | fa7d0c86004486f857ecc04d3830ae1e1713c1bc /test | |
parent | ec211ad54d5ab8fef5031b8938028acaa1c5002a (diff) | |
download | ruby-a8ba1ddd78544b4bda749051d44f7b2a8a0ec5ff.tar.gz |
Use UTF-8 encoding for literal extended regexps with UTF-8 characters in comments
Fixes [Bug #19455]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_regexp.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index f10d5f3077..d04b9cf766 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -187,6 +187,13 @@ class TestRegexp < Test::Unit::TestCase RUBY end + def test_utf8_comment_in_usascii_extended_regexp_bug_19455 + assert_separately([], <<-RUBY) + assert_equal(Encoding::UTF_8, /(?#\u1000)/x.encoding) + assert_equal(Encoding::UTF_8, /#\u1000/x.encoding) + RUBY + end + def test_union assert_equal :ok, begin Regexp.union( |