1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (rb_io_reopen): clear read buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-06-11 17:25:57 +00:00
parent cf508bfeda
commit 1d09b69f62
4 changed files with 16 additions and 3 deletions

View file

@ -1038,6 +1038,14 @@ class TestIO < Test::Unit::TestCase
safe_4 { r.reopen(t.path) }
end
end
open(__FILE__) do |f|
f.gets
assert_nothing_raised {
f.reopen(t.path)
assert_equal("foo\n", f.gets)
}
end
end
def test_foreach