summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/stringio/test_stringio.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 4c9cf37425..8b5ab37657 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -70,6 +70,16 @@ class TestStringIO < Test::Unit::TestCase
assert_nil io.getc
end
+ def test_pread_null
+ io = StringIO.new(nil)
+ assert_raise(EOFError) { io.pread(1, 0) }
+ end
+
+ def test_read_null
+ io = StringIO.new(nil)
+ assert_equal "", io.read(0)
+ end
+
def test_seek_null
io = StringIO.new(nil)
assert_equal(0, io.seek(0, IO::SEEK_SET))