summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 1011967fe9..138756eac5 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1869,6 +1869,13 @@ CODE
result = []; S("aaa,bbb,ccc,ddd").split(/,/) {|s| result << s.gsub(/./, "A")}
assert_equal(["AAA"]*4, result)
+
+ s = S("abc ") * 20
+ assert_raise(RuntimeError) {
+ 10.times do
+ s.split {s.prepend("xxx" * 100)}
+ end
+ }
ensure
EnvUtil.suppress_warning {$; = fs}
end