diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-27 08:22:17 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-27 08:22:17 +0000 |
commit | 322b26795583a0b854e7b195e7f766bd479c0404 (patch) | |
tree | 031edd791b725b9fb8a343fb083aa26eb70b4ae7 /test | |
parent | 674b2526650f317a5a836130631651dbdb019913 (diff) |
merge revision(s) 45979: [Backport #9847]
* io.c (io_setstrbuf): always check if the buffer is modifiable.
[ruby-core:62643] [Bug #9847]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index e7384390be..566564af03 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2595,25 +2595,24 @@ End def assert_buffer_not_raise_shared_string_error bug6764 = '[ruby-core:46586]' + bug9847 = '[ruby-core:62643] [Bug #9847]' size = 28 data = [*"a".."z", *"A".."Z"].shuffle.join("") t = Tempfile.new("test_io") t.write(data) t.close - w = Tempfile.new("test_io") + w = [] assert_nothing_raised(RuntimeError, bug6764) do + buf = '' File.open(t.path, "r") do |r| - buf = '' while yield(r, size, buf) - w << buf + w << buf.dup end end end - w.close - assert_equal(data, w.open.read, bug6764) + assert_equal(data, w.join(""), bug9847) ensure t.close! - w.close! end def test_read_buffer_not_raise_shared_string_error |