test: add syswrite/sysread edge case coverage#282
Draft
Koan-Bot wants to merge 1 commit intocpanel:masterfrom
Draft
test: add syswrite/sysread edge case coverage#282Koan-Bot wants to merge 1 commit intocpanel:masterfrom
Koan-Bot wants to merge 1 commit intocpanel:masterfrom
Conversation
Cover untested paths in FileHandle.pm WRITE and READ tied methods: syswrite: - zero-length write (len=0) returns 0, writes nothing - O_APPEND mode always appends even after seek - seek past EOF then write creates null-byte gap - float len truncated to int (2.9 → 2) - non-numeric len warns + EINVAL - negative len warns + EINVAL - empty buffer with len=0 sysread: - non-numeric len warns + returns undef + EINVAL - negative len warns + returns undef + EINVAL - float len truncated to int (3.7 → 3) - zero-length read returns 0 - undef buffer initialized to empty string - undef buffer with offset pads null bytes - write-only handle returns undef + EBADF - read at EOF returns 0 - write then read in O_RDWR mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add comprehensive test coverage for edge cases in
WRITEandREADtied methods inFileHandle.pm.Why
These code paths were identified as untested during audit (session 96/97 coverage gaps):
How
Single test file (
t/sysreadwrite_edge_cases.t) with 20 subtests covering both WRITE and READ tied method edge cases. Useslocal $SIG{__WARN__}to capture expected warnings without triggeringNoWarnings.Testing
Syntax-checked locally. Full CI validation pending (tests can't run locally — missing Test2 deps).
🤖 Generated with Claude Code