Repository navigation
Test closing redirections without external utilities - #264
Merged
Merged
Conversation
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
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.
[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.tstran the externalcatandechoutilities 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 uutilscatexits successfully in this situation.The tests now check the effect of closing by duplicating the closed file descriptor in a subsequent redirection (
<&- 3<&0and>&- 3>&1), which the shell itself must report as an error. The-doption is added to require a diagnostic message.Testing
make redir-p.trsandmake redir-y.trspass locally (both with and without the POSIX mode, the shell prints an error and exits with status 2).Remaining work for #262
This does not address the
job-p.tstfailure ("stdin of asynchronous list is not modified with job control"), which is caused by uutilstailreopening a seekable stdin (uutils/coreutils#16139). Thecheck-on-ubuntujob should therefore stay pinned toubuntu-24.04for now.Refs #262
Generated by Claude Code