summaryrefslogtreecommitdiff
path: root/test/stringio/test_stringio.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/stringio/test_stringio.rb')
-rw-r--r--test/stringio/test_stringio.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index d2d96c5719..cb82841231 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -750,6 +750,13 @@ class TestStringIO < Test::Unit::TestCase
assert_raise(EOFError) { f.pread(1, 5) }
assert_raise(ArgumentError) { f.pread(-1, 0) }
assert_raise(Errno::EINVAL) { f.pread(3, -1) }
+
+ assert_equal "".b, StringIO.new("").pread(0, 0)
+ assert_equal "".b, StringIO.new("").pread(0, -10)
+
+ buf = "stale".b
+ assert_equal "stale".b, StringIO.new("").pread(0, 0, buf)
+ assert_equal "stale".b, buf
end
def test_size