summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Oliver Nutter <[email protected]>2025-02-20 18:37:35 -0600
committergit <[email protected]>2025-02-21 00:37:40 +0000
commit7d7984642ce11c48c5f0bc1627f50ff097b9e7f5 (patch)
tree7ca7e01fc77aacf99a644a4355129fa7741cf8f3
parent0f1cb9234574d3d39c85b5b98a306306e20f068b (diff)
[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
-rw-r--r--test/stringio/test_stringio.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 8d236e5bba..a00e7b8500 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -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 = []