diff options
| author | nagachika <nagachika@ruby-lang.org> | 2024-07-15 18:03:08 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2024-07-15 18:03:08 +0900 |
| commit | c22398f96c29c2357bee50b291c358cc34837013 (patch) | |
| tree | d2d5e33b651b79a68d874c115f978d9ae1b25151 | |
| parent | b72deb7ca1198f8c799cd5e7e44635cf50abd7ec (diff) | |
merge partially d292a9b98ce03c76dbe13138d20b9fbf613cc02d. Just add the test to ensure the issue doesn't exit in ruby_3_2 branch.
| -rw-r--r-- | test/ruby/test_regexp.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 } |
