[ruby/stringio] Allow seek when underlying string is frozen

(https://github.com/ruby/stringio/pull/121)

Fixes https://github.com/ruby/stringio/pull/119. Adds a test for this expectation.

https://github.com/ruby/stringio/commit/3f90fe44c6
This commit is contained in:
Charles Oliver Nutter 2025-02-20 18:37:35 -06:00 committed by git
parent 0f1cb92345
commit 7d7984642c

View File

@ -483,6 +483,11 @@ class TestStringIO < Test::Unit::TestCase
f.close unless f.closed?
end
def test_seek_frozen_string
f = StringIO.new(-"1234")
assert_equal(0, f.seek(1))
end
def test_each_byte
f = StringIO.new("1234")
a = []