Skip to content

feat: add stat_as_fifo helper for named pipe mocking#93

Merged
atoomic merged 1 commit intocpan-authors:mainfrom
Koan-Bot:koan.atoomic/add-stat-as-fifo-helper
Apr 23, 2026
Merged

feat: add stat_as_fifo helper for named pipe mocking#93
atoomic merged 1 commit intocpan-authors:mainfrom
Koan-Bot:koan.atoomic/add-stat-as-fifo-helper

Conversation

@Koan-Bot
Copy link
Copy Markdown
Contributor

What

Adds stat_as_fifo() helper — the only file type missing from the stat_as_* family.

Why

Every file type with a -X check operator has a corresponding stat_as_* helper (directory, file, symlink, socket, chr, block) except FIFO/named pipe. Users of mock_all_from_stat who need to simulate a FIFO had to manually construct the stat array with the correct S_IFIFO mode bits, while every other type has a one-liner helper.

How

  • Added stat_as_fifo() following the exact same pattern as the existing helpers
  • Added to @STAT_HELPERS, exports, and POD
  • Added unit test in stat-helpers.t and integration test in mock-all-from-stat_basic.t (verifies -p, -e, !-f, !-d, !-S behavior)
  • Fixed CLAUDE.md referencing a non-existent mock_lstat function

Testing

Full test suite passes (make test — all tests green).

🤖 Generated with Claude Code

@atoomic
Copy link
Copy Markdown
Contributor

atoomic commented Apr 23, 2026

@Koan-Bot rebase

@atoomic atoomic marked this pull request as ready for review April 23, 2026 08:00
Every file type with a -X check had a corresponding stat_as_* helper
except FIFO (named pipe). This completes the helper family so users
of mock_all_from_stat can create FIFO stat arrays as easily as
directories, files, or sockets.

Also fixes CLAUDE.md referencing a non-existent mock_lstat function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Koan-Bot
Copy link
Copy Markdown
Contributor Author

Rebase with requested adjustments

Branch koan.atoomic/add-stat-as-fifo-helper was rebased onto main and review feedback was applied.

Stats

4 files changed, 25 insertions(+), 2 deletions(-)
Actions performed
  • Already-solved check: negative (confidence=high, reasoning=None of the recent commits on main mention stat_as_fifo, S_IFIFO, FIFO, or named pipe — the feature )
  • Resolved merge conflicts (1 round(s))
  • Rebased koan.atoomic/add-stat-as-fifo-helper onto upstream/main
  • Pre-push CI check: previous run passed
  • Force-pushed koan.atoomic/add-stat-as-fifo-helper to origin
  • CI check enqueued in ## CI (async)

CI status

CI will be checked asynchronously.


Automated by Kōan

@Koan-Bot Koan-Bot force-pushed the koan.atoomic/add-stat-as-fifo-helper branch from d3ca08f to b18e375 Compare April 23, 2026 08:11
@atoomic atoomic merged commit aee5fe5 into cpan-authors:main Apr 23, 2026
21 checks passed
@Koan-Bot Koan-Bot deleted the koan.atoomic/add-stat-as-fifo-helper branch April 24, 2026 08:02
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.

2 participants