summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 02:48:46 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 02:48:46 +0000
commit77443b2882081392f63bffa2be0f65aac21c2a8d (patch)
tree19d55ce33ea8fff81307a2e0c2722b021e13f207 /test/ruby
parent4f3f77b9f23ef288640d8faa5edb870a55b28937 (diff)
merge revision(s) 45534: [Backport #9709]
* string.c (str_buf_cat): should round up the capacity by 4KiB, but not number of rooms. [ruby-core:61886] [Bug #9709] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 3a60213c2e..1caca75247 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -2193,6 +2193,17 @@ class TestString < Test::Unit::TestCase
assert_equal(false, "\u3042".byteslice(0, 2).valid_encoding?)
assert_equal(false, ("\u3042"*10).byteslice(0, 20).valid_encoding?)
end
+
+ def test_LSHIFT_neary_long_max
+ return unless @cls == String
+ assert_ruby_status([], <<-'end;', '[ruby-core:61886] [Bug #9709]')
+ begin
+ a = "a" * 0x4000_0000
+ a << "a" * 0x1_0000
+ rescue NoMemoryError
+ end
+ end;
+ end
end
class TestString2 < TestString