diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-24 05:23:32 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-24 05:23:32 +0000 |
| commit | d6e57faa4fbf12352c9fcd0cf36bfcbcf2d2a573 (patch) | |
| tree | 2ec4e1c67c58d3f4851b3bb15902034afcbfb8e5 /test/ruby/ut_eof.rb | |
| parent | 53568bcc4dfe51e5e0897b0dffd2adf7919a03af (diff) | |
| download | ruby-d6e57faa4fbf12352c9fcd0cf36bfcbcf2d2a573.tar.gz ruby-d6e57faa4fbf12352c9fcd0cf36bfcbcf2d2a573.tar.xz ruby-d6e57faa4fbf12352c9fcd0cf36bfcbcf2d2a573.zip | |
* ext/stringio/stringio.c (strio_read): clear the buffer argument
when returning nil. [ruby-dev:22363]
* test/ruby/ut_eof.rb (TestEOF::test_eof_0, TestEOF::test_eof_1):
add buffer argument tests.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/ut_eof.rb')
| -rw-r--r-- | test/ruby/ut_eof.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/ut_eof.rb b/test/ruby/ut_eof.rb index 8b3cc8101..eff0bddc0 100644 --- a/test/ruby/ut_eof.rb +++ b/test/ruby/ut_eof.rb @@ -14,6 +14,16 @@ module TestEOF assert_equal("", f.read) assert_nil(f.read(1)) } + open_file("") {|f| + s = "x" + assert_equal("", f.read(nil, s)) + assert_equal("", s) + } + open_file("") {|f| + s = "x" + assert_nil(f.read(10, s)) + assert_equal("", s) + } end def test_eof_0_rw @@ -61,6 +71,16 @@ module TestEOF assert_equal("a", f.read) assert_nil(f.read(0)) } + open_file("a") {|f| + s = "x" + assert_equal("a", f.read(nil, s)) + assert_equal("a", s) + } + open_file("a") {|f| + s = "x" + assert_equal("a", f.read(10, s)) + assert_equal("a", s) + } end module Seek |
