diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 15:36:32 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 15:36:32 +0000 |
commit | cd0a89b0931d51015e4e94b010926f0c75767cee (patch) | |
tree | fbbffee961abcea767a1ed70f60014f2ec174e99 /test/ruby/test_string.rb | |
parent | 909291085c87b41d6718c2630ee49210eb9d9684 (diff) |
merge revision(s) r45534: [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_1@46187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 7ce1c0666c..57cea652b1 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2219,6 +2219,17 @@ class TestString < Test::Unit::TestCase assert_equal("foo", "" =~ //) RUBY 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 |