Skip to content

Add stdlib signature tests for #2967#2989

Open
ksss wants to merge 1 commit into
ruby:masterfrom
ksss:test-stdlib-signature-corrections
Open

Add stdlib signature tests for #2967#2989
ksss wants to merge 1 commit into
ruby:masterfrom
ksss:test-stdlib-signature-corrections

Conversation

@ksss

@ksss ksss commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add runtime signature tests for the core/stdlib signature corrections in #2967.

Coverage

  • IO#pathconf
  • StringIO.open (non-block form added in Correct core/stdlib signatures to match Ruby 4.0 #2967), StringIO#pread, read_nonblock (with exception: literal split), write_nonblock, sysread, ungetc (String / Integer), fcntl (always raises NotImplementedError), fsync, internal_encoding, external_encoding, set_encoding_by_bom
  • Etc::Group.each / Etc::Passwd.each block & Enumerator overloads
  • Etc::Passwd#age / comment / quota getters & setters (skipped on platforms where the member is absent)

Not covered (intentional)

  • Etc.sysconf / Etc.systmpdir nil branch — not reachable in the test environment, but the existing non-nil cases conform to the widened Integer? / String? signature
  • StringIO#external_encoding nil branch — same reason
  • Digest::Class changes — covered by raap, not by hand-written runtime tests

Generated with Claude Code

PR ruby#2967 で更新された core/stdlib の signature に対する
runtime signature test を追加する。

- IO#pathconf — pipe + Etc::PC_PIPE_BUF で検証
- StringIO singleton: open (non-block / block 両形)
- StringIO instance: pread, read_nonblock, write_nonblock, sysread,
  ungetc, fcntl (NotImplementedError), fsync, internal_encoding,
  external_encoding, set_encoding_by_bom
- Etc::Group.each / Etc::Passwd.each の block + Enumerator overload
- Etc::Passwd の age/comment/quota (member 存在で guard)

read_nonblock / write_nonblock の `exception:` キーワードは
true/false のリテラルに展開して assertion を分けた。
`exception: false` は empty 入力で nil を返す分岐があるため。

Digest::Class の変更は raap で別途検証されているため
test/stdlib/digest には手を入れていない。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ksss ksss added this to the RBS 4.1 milestone Jun 9, 2026
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.

1 participant