зеркало из https://github.com/github/ruby.git
Prevent syntax warnings in test/ruby/test_regexp.rb
This commit is contained in:
Родитель
60844ecf2e
Коммит
78cd5b3657
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче