summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-09 05:33:32 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-09 05:33:32 +0000
commit75b3b1901cfb16af3ac3bd47ba53325f0696455d (patch)
tree0571ea9d2006093a3e52a11bf53b467931a339e0 /test
parent231f7cb95ff551c4e1aa4c67d22bc36143b0ff42 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file.rb1
-rw-r--r--test/ruby/ut_eof.rb10
2 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index f51e55f0c68..3cf90f71017 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -40,4 +40,5 @@ class TestFile < Test::Unit::TestCase
f.rewind
yield f
end
+ alias open_file_rw open_file
end
diff --git a/test/ruby/ut_eof.rb b/test/ruby/ut_eof.rb
index d1ad9a5fea0..f1ce4f71989 100644
--- a/test/ruby/ut_eof.rb
+++ b/test/ruby/ut_eof.rb
@@ -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))