diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-09 03:44:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-09 03:44:55 +0000 |
commit | 68537a42198a8ef6ef3699527ebfdf05989676a4 (patch) | |
tree | d5acbf79af9327841983615096c3e7a307b8105e /test | |
parent | 0192e15b4ce61e38a239f3a3ae9c19e1d6efaa21 (diff) | |
download | ruby-68537a42198a8ef6ef3699527ebfdf05989676a4.tar.gz |
string.c: fix capacity
* 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/trunk@45534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 a35f6a3bb7..8366424c66 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2252,6 +2252,17 @@ class TestString < Test::Unit::TestCase assert_equal(:foo, s.send(:=~, /abc/)) assert_equal(:foo, s =~ /abc/, "should not use optimized instruction") 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 |