Skip to content

Test closing redirections without external utilities - #264

Merged
magicant merged 1 commit into
trunkfrom
claude/serene-galileo-lgmank
Nov 7, 2026
Merged

magicant merged 1 commit into
trunkfrom
claude/serene-galileo-lgmank

Conversation

@magicant

@magicant magicant commented Nov 7, 2026

Copy link
Copy Markdown
Owner

[AI-generated]

Summary

This is a port of magicant/yash-rs@0b899fb.

The tests "effect of input closing" and "effect of output closing" in tests/redir-p.tst ran the external cat and echo utilities with standard input or output closed. POSIX deems such an execution environment non-conforming and allows the implementation to open an unspecified file for the closed descriptor, so the utilities are not required to fail. The input closing test failed on Ubuntu 26.04, whose uutils cat exits successfully in this situation.

The tests now check the effect of closing by duplicating the closed file descriptor in a subsequent redirection (<&- 3<&0 and >&- 3>&1), which the shell itself must report as an error. The -d option is added to require a diagnostic message.

Testing

  • make redir-p.trs and make redir-y.trs pass locally (both with and without the POSIX mode, the shell prints an error and exits with status 2).
  • Not tested on an Ubuntu 26.04 runner.

Remaining work for #262

This does not address the job-p.tst failure ("stdin of asynchronous list is not modified with job control"), which is caused by uutils tail reopening a seekable stdin (uutils/coreutils#16139). The check-on-ubuntu job should therefore stay pinned to ubuntu-24.04 for now.

Refs #262


Generated by Claude Code

The tests "effect of input closing" and "effect of output closing"
ran the external cat and echo utilities with standard input or output
closed. POSIX deems such an execution environment non-conforming and
allows the implementation to open an unspecified file for the closed
descriptor, so the utilities are not required to fail. The input
closing test failed on Ubuntu 26.04, whose uutils cat exits
successfully in this situation.

The tests now check the effect of closing by duplicating the closed
file descriptor in a subsequent redirection, which the shell itself
must report as an error.

This is a port of magicant/yash-rs@0b899fb.

Refs #262

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01McR7qLyqJ7xM6y7cL7rNpR
@magicant
magicant merged commit 2172cda into trunk Nov 7, 2026
6 checks passed
@magicant
magicant deleted the claude/serene-galileo-lgmank branch November 7, 2026 09:00
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