summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 4cd35d5248..06c6d1c633 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -800,4 +800,11 @@ class TestRegexp < Test::Unit::TestCase
assert_nothing_raised { eval("a = 1; /\#{ a }/; a") }
assert_nothing_raised { eval("a = 1; /\#{ a }/o; a") }
end
+
+ def test_optimize_last_anycharstar
+ s = "1" + " " * 5000000
+ assert_nothing_raised { s.match(/(\d) (.*)/) }
+ assert_equal("1", $1)
+ assert_equal(" " * 4999999, $2)
+ end
end