aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
authorTSUYUSATO Kitsune <make.just.on@gmail.com>2023-03-13 18:31:13 +0900
committerGitHub <noreply@github.com>2023-03-13 18:31:13 +0900
commitdddc542e9b61b292d80a96d0d0efbbf58719e3be (patch)
tree667dd3206c3a66e05d9cc0cb3a9e954ee1ddacc1 /test/ruby/test_regexp.rb
parent1e73bdbfc49b47ab5f45506f2a2a70660ee0e6e2 (diff)
downloadruby-dddc542e9b61b292d80a96d0d0efbbf58719e3be.tar.gz
[Bug #19476]: correct cache index computation for repetition (#7457)
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index f3b9f68ffd..a2997af106 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -1765,6 +1765,11 @@ class TestRegexp < Test::Unit::TestCase
end;
end
+ def test_bug_19476 # [Bug #19476]
+ assert_equal("123456789".match(/(?:x?\dx?){2,10}/)[0], "123456789")
+ assert_equal("123456789".match(/(?:x?\dx?){2,}/)[0], "123456789")
+ end
+
def test_linear_time_p
assert_send [Regexp, :linear_time?, /a/]
assert_send [Regexp, :linear_time?, 'a']