summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2024-01-29 16:37:37 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2024-01-29 17:11:08 -0500
commit4cf3c026de54499e79f61ae284b834565a6706e4 (patch)
treea661df1f1ffd38fef6322be23f74b6f378bddbb9
parent2d6f7d0864d0a19b2ab38ebb2022487d34568c24 (diff)
Fix RegExp warning causing flaky Ripper failure
Sometimes this file get picked up and break Ripper tests: TestRipper::Generic#test_parse_files:test/ruby assert_separately failed with error message pid 63392 exit 0 | test_regexp.rb:2025: warning: character class has duplicated range https://github.com/ruby/ruby/actions/runs/7699956651/job/20982702553#step:12:103
-rw-r--r--test/ruby/test_regexp.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 390a8cb193..2de622f9a5 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -2022,7 +2022,7 @@ class TestRegexp < Test::Unit::TestCase
def test_bug_20212 # [Bug #20212]
regex = Regexp.new(
- /\A((?=.*?[a-z])(?!.*--)[a-z\d]+[a-z\d-]*[a-z\d]+).((?=.*?[a-z])(?!.*--)[a-z\d]+[a-z\d-]*[a-z\d]+).((?=.*?[a-z])(?!.*--)[a-zd]+[a-zd-]*[a-zd]+).((?=.*?[a-z])(?!.*--)[a-zd]+[a-zd-]*[a-zd]+)\Z/x
+ /\A((?=.*?[a-z])(?!.*--)[a-z\d]+[a-z\d-]*[a-z\d]+).((?=.*?[a-z])(?!.*--)[a-z\d]+[a-z\d-]*[a-z\d]+).((?=.*?[a-z])(?!.*--)[a-z]+[a-z-]*[a-z]+).((?=.*?[a-z])(?!.*--)[a-z]+[a-z-]*[a-z]+)\Z/x
)
string = "www.google.com"
100.times.each { assert(regex.match?(string)) }