mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_init): rewind when reopened.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9e412b83a0
commit
d222472299
3 changed files with 8 additions and 2 deletions
|
@ -252,11 +252,11 @@ class TestStringIO < Test::Unit::TestCase
|
|||
f = StringIO.new("foo\nbar\nbaz\n")
|
||||
assert_equal("foo\n", f.gets)
|
||||
f.reopen("qux\nquux\nquuux\n")
|
||||
assert_equal("quux\n", f.gets)
|
||||
assert_equal("qux\n", f.gets)
|
||||
|
||||
f2 = StringIO.new("")
|
||||
f2.reopen(f)
|
||||
assert_equal("quuux\n", f2.gets)
|
||||
assert_equal("quux\n", f2.gets)
|
||||
ensure
|
||||
f.close unless f.closed?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue