fix: App::perlbrew support improvements — 68/73 tests pass#456
Merged
Conversation
- Add instanceof TieHandle checks in RuntimeScalar.tiedStore() and tiedFetch() to avoid ClassCastException when Capture::Tiny ties filehandles (TieHandle extends RuntimeIO, not TiedVariableBase) - Update app_perlbrew.md: Phase 6 complete (57/73 tests pass, up from 18/73), categorize 16 remaining failures, add Phase 7 plan for tied STDOUT selectedHandle fix Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
When Test2::Plugin::IOEvents ties STDOUT, print without explicit filehandle was bypassing the tie because RuntimeIO.selectedHandle still pointed to the original untied handle. Fix: TieOperators.tie() and untie() now check if the glob being tied/untied is the currently-selected handle and update selectedHandle accordingly. This ensures print goes through the TieHandle PRINT method. stat(STDOUT) fix was NOT needed: analysis showed that _check_for_change() comparing undef-to-undef is safe, and the TAP formatter dups STDOUT before IOEvents ties it. Result: App::perlbrew tests 57/73 -> 65/73 pass. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ures Document all 8 remaining test failures with symptoms, root causes, code locations, and proposed fixes. Prioritized by complexity: 1. FileSpec.path() reads Java env instead of Perl %ENV 2. glob patterns don't interpolate variables 3. B::svref_2object missing GLOB ref detection 4. Capture::Tiny + tied STDOUT selectedHandle interaction (5 tests) Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Priority 1: FileSpec.path() now reads from Perl %ENV instead of
System.getenv, so $ENV{PATH} modifications are respected. Also
fix ArgumentParser.java for -S flag.
Priority 2: Diamond operator <$var/*.t> now interpolates variables
using double-quote semantics (StringParser, EmitOperator, CompileOperator).
Both JVM and bytecode backends updated to correctly distinguish
readline vs glob when operand is not a simple StringNode.
Priority 3: B::svref_2object now detects GLOB refs and returns B::GV.
Added B::GV::SV method and B::SPECIAL class for Test2::Util::Stash.
Priority 4A: Stat.java and FileTestOperator.java now unwrap
DupIOHandle and BorrowedIOHandle (not just LayeredIOHandle) to
reach the underlying CustomFileChannel for stat/file-test ops.
Priority 4B: RuntimeGlob.dynamicSaveState/Restore now saves and
restores selectedHandle, and initializes new glob with stub IO
when the old glob was the selected handle. This ensures print
follows localized STDOUT during local(*STDOUT).
Tests fixed: http-ua-detect-non-curl.t, unit-files-are-the-same.t,
util-looks-like.t
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
84692aa to
98a17e4
Compare
…ments PerlOnJava parsed `tied *STDOUT && expr` as `tied(*STDOUT && expr)` instead of `(tied *STDOUT) && expr`. This caused Capture::Tiny to skip its `local(*STDOUT)` call when STDOUT was tied by Test2::Plugin::IOEvents, corrupting the selectedHandle and breaking print output capture. The fix adds parseBackslashArgWithComma() which parses backslash prototype arguments at named-unary precedence (level 15, same as isa) instead of comma precedence (level 5). This matches Perl 5 behavior where comparison/logical operators are NOT consumed but arithmetic operators ARE consumed. App::perlbrew: 65/73 -> 66/73 tests pass. Generated with Devin (https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
98a17e4 to
11a068d
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
Improvements to App::perlbrew CPAN test support, going from 57/73 to 68/73 passing tests.
Phase 7.1: TieHandle + selectedHandle fixes (57→65)
RuntimeScalar.tiedStore/tiedFetchselectedHandlewhen tying/untying the currently-selected STDOUT handlePhase 7.2: Three more fixes (65→68)
%ENVinstead ofSystem.getenvso $ENV{PATH} modifications are respected<$var/*.t>now interpolates variables using double-quote semanticssvref_2objectdetects GLOB refs (returnsB::GV), addedB::GV::SVandB::SPECIALDupIOHandle/BorrowedIOHandle(not justLayeredIOHandle)selectedHandleduringlocal(*STDOUT)Remaining 5 failures
All share the Capture::Tiny + Test2::Plugin::IOEvents tied STDOUT interaction issue. Detailed root cause analysis documented in
dev/modules/app_perlbrew.md.Files Changed
ArgumentParser.java— Read PATH from Perl %ENV for -S flagCompileOperator.java/EmitOperator.java— Diamond operator readline vs glob detectionStringParser.java— Variable interpolation in<>glob patternsFileSpec.java—path()reads from Perl %ENVStat.java/FileTestOperator.java— Unwrap DupIOHandle/BorrowedIOHandleRuntimeGlob.java— selectedHandle save/restore in dynamicSaveState/RestoreStateRuntimeScalar.java— TieHandle instanceof guardsB.pm— GLOB ref detection, B::GV::SV, B::SPECIAL classTest plan
makepasses (all unit tests green)./jcpan -t App::perlbrew— 68/73 pass (3 more tests fixed, no regressions)Generated with Devin