mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
231f7cb95f
commit
75b3b1901c
2 changed files with 11 additions and 0 deletions
|
@ -40,4 +40,5 @@ class TestFile < Test::Unit::TestCase
|
||||||
f.rewind
|
f.rewind
|
||||||
yield f
|
yield f
|
||||||
end
|
end
|
||||||
|
alias open_file_rw open_file
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,6 +16,16 @@ module TestEOF
|
||||||
}
|
}
|
||||||
end
|
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
|
def test_eof_1
|
||||||
open_file("a") {|f|
|
open_file("a") {|f|
|
||||||
assert_equal("", f.read(0))
|
assert_equal("", f.read(0))
|
||||||
|
|
Loading…
Add table
Reference in a new issue