Skip to content

Add Symbol#casecmp, #casecmp?, #match and #match? - #476

Merged
tannevaled merged 1 commit into
mainfrom
feat/cluster46
Aug 28, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/cluster46

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Symbol gains the last of its String-delegating query methods:

  • casecmp / casecmp? compare symbol names case-insensitively, but only
    against another Symbol — any other argument yields nil, as MRI does (a
    String is never coerced here).
  • match / match? run a Regexp or String pattern against the symbol
    name by delegating to String, so #match still sets $~.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises 15880 → 15890 (core/symbol casecmp +8, match +5, zero
regressions in a deterministic per-file sweep).

🤖 Generated with Claude Code

Symbol gained the last of its String-delegating query methods:

- casecmp / casecmp? compare symbol names case-insensitively, but only against
  another Symbol — any other argument yields nil, as MRI does (a String is never
  coerced here).
- match / match? run a Regexp or String pattern against the symbol name by
  delegating to String, so #match still sets $~.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
floor rises 15880 -> 15890 (core/symbol casecmp +8, match +5).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 397dd58 into main Aug 28, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/cluster46 branch August 28, 2026 12:54
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