From 77443b2882081392f63bffa2be0f65aac21c2a8d Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 27 May 2014 02:48:46 +0000 Subject: 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 --- test/ruby/test_string.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3