From e22c4e8877677ff90805e4a4dcbdef80f4220136 Mon Sep 17 00:00:00 2001 From: TSUYUSATO Kitsune Date: Mon, 13 Mar 2023 15:46:41 +0900 Subject: [Bug #19467] correct cache points and counting failure on `OP_ANYCHAR_STAR_PEEK_NEXT` (#7454) --- test/ruby/test_regexp.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index ae2bf82bb8..2fc418d96f 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -1755,6 +1755,16 @@ class TestRegexp < Test::Unit::TestCase assert_equal("10:0:0".match(pattern)[0], "10:0:0") end + def test_bug_19467 + assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}") + timeout = #{ EnvUtil.apply_timeout_scale(10).inspect } + begin; + Regexp.timeout = timeout + + assert_nil(/\A.*a.*z\z/ =~ "a" * 1000000 + "y") + end; + end + def test_linear_time_p assert_send [Regexp, :linear_time?, /a/] assert_send [Regexp, :linear_time?, 'a'] -- cgit v1.2.3