From b9faa6b74ca443157ed93172bd3cd7bb44141ba5 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 31 Jan 2009 10:15:30 +0000 Subject: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby/test_io.rb') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 708e25d766..0c1c6b2d2b 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -812,6 +812,17 @@ class TestIO < Test::Unit::TestCase end end + def test_readpartial_pos + mkcdtmpdir { + open("foo", "w") {|f| f << "abc" } + open("foo") {|f| + f.seek(0) + assert_equal("ab", f.readpartial(2)) + assert_equal(2, f.pos) + } + } + end + def test_read pipe(proc do |w| w.write "foobarbaz" -- cgit v1.2.3