diff options
author | Yusuke Endoh <[email protected]> | 2024-01-11 17:04:13 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2024-01-11 17:04:13 +0900 |
commit | 78cd5b36576a55429bd15f5cabacfd4e790c0076 (patch) | |
tree | 9a4b28cb053a5f7fd2e6ff86466c293ae69345a0 /test/ruby/test_regexp.rb | |
parent | 60844ecf2e63a4c0ff1c248908497a7b6665a42a (diff) |
Prevent syntax warnings in test/ruby/test_regexp.rb
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r-- | test/ruby/test_regexp.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 0d6ab4682d..7206e858d0 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -716,7 +716,7 @@ class TestRegexp < Test::Unit::TestCase h = {} ObjectSpace.count_objects(h) prev_matches = h[:T_MATCH] || 0 - md = /[A-Z]/.match('1') # no match + _md = /[A-Z]/.match('1') # no match ObjectSpace.count_objects(h) new_matches = h[:T_MATCH] || 0 assert_equal prev_matches, new_matches, "Bug [#20104]" @@ -2009,11 +2009,11 @@ class TestRegexp < Test::Unit::TestCase end def test_bug_20098 # [Bug #20098] - assert /a((.|.)|bc){,4}z/.match? 'abcbcbcbcz' - assert /a(b+?c*){4,5}z/.match? 'abbbccbbbccbcbcz' - assert /a(b+?(.|.)){2,3}z/.match? 'abbbcbbbcbbbcz' - assert /a(b*?(.|.)[bc]){2,5}z/.match? 'abcbbbcbcccbcz' - assert /^(?:.+){2,4}?b|b/.match? "aaaabaa" + assert(/a((.|.)|bc){,4}z/.match? 'abcbcbcbcz') + assert(/a(b+?c*){4,5}z/.match? 'abbbccbbbccbcbcz') + assert(/a(b+?(.|.)){2,3}z/.match? 'abbbcbbbcbbbcz') + assert(/a(b*?(.|.)[bc]){2,5}z/.match? 'abcbbbcbcccbcz') + assert(/^(?:.+){2,4}?b|b/.match? "aaaabaa") end def test_linear_time_p |