Skip to content

Add Kernel#test - #485

Merged
tannevaled merged 1 commit into
mainfrom
feat/kernel-test
Aug 29, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/kernel-test

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Kernel#test(cmd, file1, file2 = nil) performs a single-character file test,
delegating to the matching File query: ?e/?f/?d/?l existence and type,
?r/?w/?x (and the real-uid ?R/?W/?X) access, ?s size (nil when
empty), ?z zero-size, and ?M/?A/?C the modification/access/change times.
The command may be a ?x character literal (an Integer) or a one-character
String; an unknown command raises ArgumentError. Like MRI it is a private
method, so it does not appear in respond_to?.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises 16250 → 16260 (core/kernel/test 0 → 11, zero regressions in
a per-file sweep).

🤖 Generated with Claude Code

Kernel#test(cmd, file1, file2 = nil) performs a single-character file test,
delegating to the matching File query: ?e/?f/?d/?l existence and type, ?r/?w/?x
(and the real-uid ?R/?W/?X) access, ?s size (nil when empty), ?z zero-size, and
?M/?A/?C the modification/access/change times. The command may be a ?x character
literal (an Integer) or a one-character String; an unknown command raises
ArgumentError. Like MRI it is a private method, so it does not appear in
respond_to?.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
floor rises 16250 -> 16260 (core/kernel/test 0 -> 11).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 9ce9adf into main Aug 29, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/kernel-test branch August 29, 2026 19:45
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