diff options
author | Daniel Colson <danieljamescolson@gmail.com> | 2024-04-25 10:45:16 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2024-04-25 11:28:56 -0400 |
commit | 3a5d9553a7b2c21d121160b1646e43884825ede0 (patch) | |
tree | 0958057c06d8ab8999a4ed988afe3df6ff55ab36 /test/ruby | |
parent | d292a9b98ce03c76dbe13138d20b9fbf613cc02d (diff) |
Don't use assert_separately in Bug 20453 test
https://github.com/ruby/ruby/pull/10630#discussion_r1579565056
The PR was merged before I had a chance to address this feedback.
`assert_separately` is not necessary for this test if I don't use a
global timeout.
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_regexp.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 03d96954b4..c72029ca80 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -1828,14 +1828,11 @@ class TestRegexp < Test::Unit::TestCase end def test_bug_20453 - assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}") - begin; - Regexp.timeout = 0.001 + re = Regexp.new("^(a*)x$", timeout: 0.001) - assert_raise(Regexp::TimeoutError) do - /^(a*)x$/ =~ "a" * 1000000 + "x" - end - end; + assert_raise(Regexp::TimeoutError) do + re =~ "a" * 1000000 + "x" + end end def per_instance_redos_test(global_timeout, per_instance_timeout, expected_timeout) |