summaryrefslogtreecommitdiff
path: root/test/ruby/ut_eof.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-23 19:53:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-23 19:53:45 +0000
commit0a4fc3d71ba383af2eb2da62509d3c5537eebb68 (patch)
treeb9353d3b26f0ff6144fc628574d90bec093b90d4 /test/ruby/ut_eof.rb
parenta3ecd5c83d57fb1556a40113f1b0c69c87261e33 (diff)
* io.c (read_all): do not return nil at the end of file.
[ruby-dev:22334] * io.c (argf_read): do not depend on nil at eof behavior of IO#read(). * eval.c (rb_thread_join): dup exception before re-raising it. * io.c (rb_io_eof): call clearerr() to prevent side effect. this patch is supplied by Masahiro Sakai <sakai@tom.sfc.keio.ac.jp>. [ruby-dev:22234] * pack.c (OFF16): get offset for big endian machines. * pack.c (pack_pack): use OFF16 instead of OFF16B. [ruby-dev:22344] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/ut_eof.rb')
-rw-r--r--test/ruby/ut_eof.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/ruby/ut_eof.rb b/test/ruby/ut_eof.rb
index d4b0b6db39c..8b3cc8101ba 100644
--- a/test/ruby/ut_eof.rb
+++ b/test/ruby/ut_eof.rb
@@ -11,7 +11,7 @@ module TestEOF
}
open_file("") {|f|
assert_nil(f.read(1))
- assert_nil(f.read)
+ assert_equal("", f.read)
assert_nil(f.read(1))
}
end
@@ -20,9 +20,9 @@ module TestEOF
return unless respond_to? :open_file_rw
open_file_rw("") {|f|
assert_equal("", f.read)
- assert_nil(f.read)
+ assert_equal("", f.read)
assert_equal(0, f.syswrite(""))
- assert_nil(f.read)
+ assert_equal("", f.read)
}
end
@@ -43,19 +43,19 @@ module TestEOF
open_file("a") {|f|
assert_equal("a", f.read(2))
assert_nil(f.read(1))
- assert_nil(f.read)
+ assert_equal("", f.read)
assert_nil(f.read(1))
}
open_file("a") {|f|
assert_equal("a", f.read)
assert_nil(f.read(1))
- assert_nil(f.read)
+ assert_equal("", f.read)
assert_nil(f.read(1))
}
open_file("a") {|f|
assert_equal("a", f.read(2))
- assert_nil(f.read)
- assert_nil(f.read)
+ assert_equal("", f.read)
+ assert_equal("", f.read)
}
open_file("a") {|f|
assert_equal("a", f.read)
@@ -77,18 +77,18 @@ module TestEOF
assert_equal("", f.read(0))
assert_equal("", f.read)
assert_nil(f.read(0))
- assert_nil(f.read)
+ assert_equal("", f.read)
}
end
def test_eof_1_seek
open_file_seek("a", 10) {|f|
assert_equal("", f.read)
- assert_nil(f.read)
+ assert_equal("", f.read)
}
open_file_seek("a", 1) {|f|
assert_equal("", f.read)
- assert_nil(f.read)
+ assert_equal("", f.read)
}
end
end