diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-05-24 16:51:15 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-06-20 19:35:12 +0900 |
commit | ab2a43265cfdda288d1baaa29936fd408c2a42bc () | |
tree | f70d3b5b1c9ddb1c8a259642f9ede21a25afc173 /test/ruby/test_regexp.rb | |
parent | a58611dfb1bfc74fb1a51a9cd0ca8ac690c2f1f4 (diff) |
Warn suspicious flag to `Regexp.new`
Now second argument should be `true`, `false`, `nil` or Integer. This flag is confused with third argument some times.
Notes: Merged: https://.com/ruby/ruby/pull/6039
-rw-r--r-- | test/ruby/test_regexp.rb | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -628,6 +628,12 @@ class TestRegexp < Test::Unit::TestCase assert_raise(RegexpError) { Regexp.new("((?<v>))\\g<0>") } end def test_match_control_meta_escape assert_equal(0, /\c\xFF/ =~ "\c\xFF") assert_equal(0, /\c\M-\xFF/ =~ "\c\M-\xFF") |