about summary refs log tree commit homepage
path: root/test/lib_read_write.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-10-08 02:53:38 -0700
committerEric Wong <e@yhbt.net>2010-10-08 09:58:58 +0000
commitd225ede82d820d045bd7cfb826f444cf6601577c (patch)
tree1515ff26c7645a643048359827e61191c189095e /test/lib_read_write.rb
parente4599227f0da0f652cbcb52838e631d7384dcd0d (diff)
downloadkgio-d225ede82d820d045bd7cfb826f444cf6601577c.tar.gz
This matches behavior of all the core Ruby methods.
Diffstat (limited to 'test/lib_read_write.rb')
-rw-r--r--test/lib_read_write.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lib_read_write.rb b/test/lib_read_write.rb
index 6296586..6f90041 100644
--- a/test/lib_read_write.rb
+++ b/test/lib_read_write.rb
@@ -18,6 +18,20 @@ module LibReadWriteTest
     end
   end
 
+  def test_read_zero
+    assert_equal "", @rd.kgio_read(0)
+    buf = "foo"
+    assert_equal buf.object_id, @rd.kgio_read(0, buf).object_id
+    assert_equal "", buf
+  end
+
+  def test_tryread_zero
+    assert_equal "", @rd.kgio_tryread(0)
+    buf = "foo"
+    assert_equal buf.object_id, @rd.kgio_tryread(0, buf).object_id
+    assert_equal "", buf
+  end
+
   def test_read_eof
     @wr.close
     assert_nil @rd.kgio_read(5)