fix: align unit tests with system Perl behavior#476
Merged
Conversation
Three fixes for parity with system Perl: 1. $\ interpolation in double-quoted strings: Remove backslash from the non-interpolating characters set so "$\" is recognized as the output record separator variable, matching Perl's greedy capture. 2. sysread on in-memory handles: Return undef with "Bad file descriptor" error instead of reading data, matching Perl behavior where sysread/syswrite don't work on in-memory (PerlIO::scalar) handles. 3. IPC::Open3 stderr merging: Check truthiness (not just definedness) of the error handle parameter. Per IPC::Open3 docs, a false $err (including "") means stderr merges with stdout. Test fixes: - string_interpolation.t: expect "$\\" to equal "\" (not "") - sysread_syswrite.t: expect sysread on in-memory handle to return undef - ipc_open3.t: fix tests that used $err="" expecting separate stderr; use gensym for fileno test, expect merged output for empty-string tests Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
8794a55 to
98796ea
Compare
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.
Summary
Three fixes to align jperl behavior with system Perl, resolving unit test failures found via prove src/test/resources/unit:
Test fixes
All three test files now produce identical pass/fail results on both system Perl and jperl.
Test plan
Generated with Devin