summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2023-07-17 17:23:31 +0900
committernagachika <nagachika@ruby-lang.org>2023-07-17 17:23:31 +0900
commitbe09d77b966c7bcc77957927f16cefe66b365495 (patch)
tree934ffe2389d8196fabccc57aa7b51ac88a0b26d0 /test/ruby
parent5fbd72764e020c6b165604e9cdcc932a1c5d2a93 (diff)
merge revision(s) a8ba1ddd78544b4bda749051d44f7b2a8a0ec5ff: [Backport #19455]
Use UTF-8 encoding for literal extended regexps with UTF-8 characters in comments Fixes [Bug #19455] --- re.c | 9 ++++++++- test/ruby/test_regexp.rb | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-)
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_regexp.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index b515ff8b14..873b5a04d8 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -200,6 +200,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(