[ruby/stringio] Fix SEGV at eof? on null StringIO

29b9133332
This commit is contained in:
Nobuyoshi Nakada 2025-08-09 19:45:25 +09:00 committed by git
parent 31f2d8990d
commit b4d5ebcd12

View file

@ -70,6 +70,11 @@ class TestStringIO < Test::Unit::TestCase
assert_nil io.getc assert_nil io.getc
end end
def test_pread_eof
io = StringIO.new(nil)
assert_predicate io, :eof?
end
def test_pread_null def test_pread_null
io = StringIO.new(nil) io = StringIO.new(nil)
assert_raise(EOFError) { io.pread(1, 0) } assert_raise(EOFError) { io.pread(1, 0) }