summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2022-06-16 18:53:35 +0900
committerNobuyoshi Nakada <[email protected]>2022-06-20 19:35:12 +0900
commit1e9939dae24db232d6f3693630fa37a382e1a6d7 ()
tree7bb1660444a068ce185c4ef636467861b40cae6c /test/ruby/test_regexp.rb
parent39dc455b511614ee8a1911c0ba6445a0307d5e4f (diff)
[Feature #18788] Support options as `String` to `Regexp.new`
`Regexp.new` now supports passing the regexp flags not only as an `Integer`, but also as a `String. Unknown flags raise errors.
Notes: Merged: https://.com/ruby/ruby/pull/6039
-rw-r--r--test/ruby/test_regexp.rb17
1 files changed, 17 insertions, 0 deletions
@@ -634,6 +634,23 @@ class TestRegexp < Test::Unit::TestCase
end
end
def test_match_control_meta_escape
assert_equal(0, /\c\xFF/ =~ "\c\xFF")
assert_equal(0, /\c\M-\xFF/ =~ "\c\M-\xFF")