From c22398f96c29c2357bee50b291c358cc34837013 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 15 Jul 2024 18:03:08 +0900 Subject: merge partially d292a9b98ce03c76dbe13138d20b9fbf613cc02d. Just add the test to ensure the issue doesn't exit in ruby_3_2 branch. --- test/ruby/test_regexp.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 873b5a04d8..b385760b42 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -1714,6 +1714,17 @@ class TestRegexp < Test::Unit::TestCase end; end + def test_bug_20453 + assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}") + begin; + Regexp.timeout = 0.001 + + assert_raise(Regexp::TimeoutError) do + /^(a*)x$/ =~ "a" * 1000000 + "x" + end + end; + end + def per_instance_redos_test(global_timeout, per_instance_timeout, expected_timeout) assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}") global_timeout = #{ EnvUtil.apply_timeout_scale(global_timeout).inspect } -- cgit v1.2.3