summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2022-12-29 15:59:52 +0900
committerNARUSE, Yui <naruse@airemix.jp>2022-12-29 15:59:52 +0900
commita7d467a792c644a7260d6560ea2002fdb8ff6de3 (patch)
tree5f64b29c35698c79df887148faf1c8b67258fe10 /test/ruby
parent5c551ac59f9620901394a46dffda5a1833b9c4b0 (diff)
merge revision(s) b726d60c986bf951d13e7a2ab5f5e58f58657b03: [Backport #19273]
Fix [Bug 19273], set correct value to `outer_repeat` on `OP_REPEAT` (#7035) --- regexec.c | 2 +- test/ruby/test_regexp.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
Diffstat (limited to 'test/ruby')
-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 40d3559c0b..98bf41d2f1 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -1721,6 +1721,11 @@ class TestRegexp < Test::Unit::TestCase
end;
end
+ def test_bug_19273 # [Bug #19273]
+ pattern = /(?:(?:-?b)|(?:-?(?:1_?(?:0_?)*)?0))(?::(?:(?:-?b)|(?:-?(?:1_?(?:0_?)*)?0))){0,3}/
+ assert_equal("10:0:0".match(pattern)[0], "10:0:0")
+ end
+
def test_linear_time_p
assert_send [Regexp, :linear_time?, /a/]
assert_send [Regexp, :linear_time?, 'a']