Skip to content

test: add coverage for untested redirect operators and init subs - #293

Draft
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/test-redirect-init-coverage
Draft

test: add coverage for untested redirect operators and init subs#293
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/test-redirect-init-coverage

Conversation

@toddr-bot

Copy link
Copy Markdown
Contributor

What

16 new tests covering redirect operators and features that had zero test coverage.

Why

Several documented IPC::Run features were never exercised by the test suite:

  • >& and &>pipe (combined stdout+stderr redirects)
  • init subs (pre-exec child callbacks) and their exception propagation
  • Filters applied to stderr (fd 2)
  • Numbered fd redirects (3>)

Without tests, regressions in these features would go undetected.

How

New test file t/redirect_init.t with 16 tests:

  • 5 tests for >& redirect (sync and async)
  • 3 tests for &>pipe redirect via pipe filehandle
  • 4 tests for init subs (env propagation, exception handling)
  • 2 tests for filters on stderr
  • 2 tests for 3> numbered fd redirect

Testing

All 879 tests pass (16 new). Only pre-existing t/pty.t skip (IO::Pty < 1.25).

🤖 Generated with Claude Code

Exercise previously untested IPC::Run features:

- &> redirect: captures both stdout and stderr to a single scalar
- &>pipe redirect: combines stdout+stderr to a pipe filehandle
- init sub: runs in child before exec, sets environment
- init sub exception: die() in init propagates to parent
- Filters on stderr (fd 2): filter functions applied to stderr output
- Numbered fd redirect (3>): captures output from fd 3

These 16 tests cover redirect operators and features that had zero test
coverage despite being fully implemented.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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