add test for previous change to io.c.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2003-12-09 05:33:32 +00:00
parent 231f7cb95f
commit 75b3b1901c
2 changed files with 11 additions and 0 deletions

View File

@ -40,4 +40,5 @@ class TestFile < Test::Unit::TestCase
f.rewind
yield f
end
alias open_file_rw open_file
end

View File

@ -16,6 +16,16 @@ module TestEOF
}
end
def test_eof_0_rw
return unless respond_to? :open_file_rw
open_file_rw("") {|f|
assert_equal("", f.read)
assert_equal(nil, f.read)
assert_equal(0, f.syswrite(""))
assert_equal(nil, f.read)
}
end
def test_eof_1
open_file("a") {|f|
assert_equal("", f.read(0))