diff options
-rw-r--r-- | test/ruby/test_io.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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" |