summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-16 07:00:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-16 07:00:23 +0000
commit39acf90c07686087d12f1a7a39d161a535e0e97f (patch)
treeec4c71aa968a4c9e52b246edb02bc8e1af49b324 /test
parent6b58f44906b6df75044dda099f28130b00149e4f (diff)
downloadruby-39acf90c07686087d12f1a7a39d161a535e0e97f.tar.gz
ruby-39acf90c07686087d12f1a7a39d161a535e0e97f.tar.xz
ruby-39acf90c07686087d12f1a7a39d161a535e0e97f.zip
* io.c (io_reopen): discards read buffer. [ruby-core:24240]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 8a5b878f3..42614e00c 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1270,6 +1270,16 @@ class TestIO < Test::Unit::TestCase
assert_equal("foo\n", f.gets)
}
end
+
+ open(__FILE__) do |f|
+ f.gets
+ f2 = open(t.path)
+ f2.gets
+ assert_nothing_raised {
+ f.reopen(f2)
+ assert_equal("bar\n", f.gets, '[ruby-core:24240]')
+ }
+ end
end
def test_foreach