summaryrefslogtreecommitdiffstats
path: root/test/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 07:06:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 07:06:21 +0000
commita7e0a3886e396dff52cda53f983e614e88069644 (patch)
tree4c2d76c61233f744695da926d8a58fc21cdc0ef9 /test/stringio
parent82ee5772e71daef31e2675d49c4a374415c2d4eb (diff)
downloadruby-a7e0a3886e396dff52cda53f983e614e88069644.tar.gz
ruby-a7e0a3886e396dff52cda53f983e614e88069644.tar.xz
ruby-a7e0a3886e396dff52cda53f983e614e88069644.zip
* ext/stringio/stringio.c (strio_write): insufficiently filled string
being extended when overwriting. [ruby-core:03836] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index fee305e85..de15ab550 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -30,4 +30,14 @@ class TestStringIO < Test::Unit::TestCase
io.print "last"
assert_equal("\0" * n + "last", io.string)
end
+
+ def test_overwrite # [ruby-core:03836]
+ stringio = StringIO.new
+ responses = ['', 'just another ruby', 'hacker']
+ responses.each do |resp|
+ stringio.puts(resp)
+ stringio.rewind
+ end
+ assert_equal("hacker\nother ruby\n", stringio.string)
+ end
end