From 1d09b69f62d1f779f4f446a743036b6fe8c5d59a Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 11 Jun 2008 17:25:57 +0000 Subject: * 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 --- test/ruby/test_io.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby/test_io.rb') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 6e6a27f015..313fc0c864 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -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 -- cgit v1.2.3