Skip to content

Avoid splitting undefined capture output - #65

Open
salva wants to merge 1 commit into
masterfrom
fix/capture-undef-output
Open

Avoid splitting undefined capture output#65
salva wants to merge 1 commit into
masterfrom
fix/capture-undef-output

Conversation

@salva

@salva salva commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Avoid splitting undefined output in list-context capture after _io3 errors.

Changes

  • Return an empty list before splitting if _io3 returned undef output.
  • Add an integration assertion covering decode failure in list-context capture.

Fixes #43.

Testing

  • perl -Ilib -c lib/Net/OpenSSH.pm
  • perl -Ilib t/1_run.t

Copilot AI review requested due to automatic review settings June 4, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a list-context edge case in Net::OpenSSH->capture where, after an _io3 decoding/stream error, the method could attempt to split an undefined $output. It aligns capture’s list-context behavior with the failure semantics described in issue #43 by returning an empty list early when no output was produced.

Changes:

  • In capture, return () in list context when _io3 returns undefined output (avoids splitting undef).
  • Add an integration assertion ensuring list-context capture returns an empty list on encoding/decoding failure.
  • Update the test plan to account for the new assertions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/Net/OpenSSH.pm Guard list-context capture against undef output by returning an empty list before splitting.
t/1_run.t Add regression coverage for “bad encoding” in list-context capture, and update planned test count.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

capture can split undefined output after _io3 failure

2 participants