summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTSUYUSATO Kitsune <make.just.on@gmail.com>2023-05-22 11:27:34 +0900
committerGitHub <noreply@github.com>2023-05-22 11:27:34 +0900
commita5819b5b2510556de0719317662d96096ce4089a (patch)
tree2f9d3a6d5dc0742ff2088630dfe99862377bc49b /test
parent872249e209fdb7b7c890a93b0f93a74a62d21aec (diff)
Allow the match cache optimization for atomic groups (#7804)
Notes
Notes: Merged-By: makenowjust <make.just.on@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_regexp.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index d04b9cf766..0a72caba45 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -1760,6 +1760,16 @@ class TestRegexp < Test::Unit::TestCase
end;
end
+ def test_match_cache_atomic
+ assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}")
+ timeout = #{ EnvUtil.apply_timeout_scale(10).inspect }
+ begin;
+ Regexp.timeout = timeout
+
+ assert_nil(/^(?>a?a?)(a|a)*$/ =~ "a" * 1000000 + "x")
+ end;
+ end
+
def test_cache_opcodes_initialize
str = 'test1-test2-test3-test4-test_5'
re = '^([0-9a-zA-Z\-/]*){1,256}$'