Skip to content

Expand specs for StringIO#readpartial#1278

Merged
andrykonchin merged 3 commits into
ruby:masterfrom
herwinw:stringio_readpartial
Jul 19, 2025
Merged

Expand specs for StringIO#readpartial#1278
andrykonchin merged 3 commits into
ruby:masterfrom
herwinw:stringio_readpartial

Conversation

@herwinw
Copy link
Copy Markdown
Member

@herwinw herwinw commented Jul 18, 2025

Try to sync it with IO#readpartial as much as possible. There are two exceptions:

  • The specs for IO#readpartial have two specs for a closed IO-object. These tests are different, one closes the read-end of the pipe, the other closes the write-end of the pipe. The specs for StringIO#readpartial had the same test twice, this duplication has been fixed.
  • The behaviour for multibyte is different, this test has been omitted in the StringIO specs. This looks like an upstream bug, I've created https://bugs.ruby-lang.org/issues/21517 to handle that.

herwinw added 3 commits July 18, 2025 09:33
The same test was at the bottom of the specs, grouped with the other exceptions
* Encoding of buffer argument
* Exception message validation (except for EOFError)
* Calling with length of 0 on a closed stream should raise an error.
  Added this to IO specs as well.
@herwinw
Copy link
Copy Markdown
Member Author

herwinw commented Jul 18, 2025

(P.S. I'll try to get back to my other open issues this weekend, I haven't really had the time yet to look at the remarks)

@andrykonchin
Copy link
Copy Markdown
Member

Thank you!

@andrykonchin andrykonchin merged commit 7863a1b into ruby:master Jul 19, 2025
12 checks passed
@herwinw herwinw deleted the stringio_readpartial branch August 3, 2025 18:08
herwinw added a commit to herwinw/spec that referenced this pull request Aug 3, 2025
… to StringIO#readpartial

This one was missing in ruby#1278, I got it to work with the
`encoding: binary` directive. The StringIO code was fine, the spec was
just incomplete.
eregon pushed a commit to herwinw/spec that referenced this pull request Jan 4, 2026
… to StringIO#readpartial

This one was missing in ruby#1278, I got it to work with the
`encoding: binary` directive. The StringIO code was fine, the spec was
just incomplete.
eregon pushed a commit that referenced this pull request Jan 4, 2026
… to StringIO#readpartial

This one was missing in #1278, I got it to work with the
`encoding: binary` directive. The StringIO code was fine, the spec was
just incomplete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants