Rush uses the Smoosh shell test suite as third-party compatibility evidence, not as the final POSIX authority.
When a Smoosh expectation disagrees with POSIX.1-2024 / Issue 8, rush --posix follows POSIX. The cases below are Rush's documented expected Smoosh failures.
Rush does not need to match Smoosh expectations for extension features that POSIX does not require in sh.
shell/builtin.history.nonposix: tests history, history -c, and set -o nolog.shell/builtin.source.nonexistent.earlyexit, shell/builtin.source.nonexistent, and shell/builtin.source.setvar: source is a compatibility alias, not the POSIX dot utility.shell/builtin.test.numeric.spaces.nonposix: accepts non-POSIX integer operands with leading or trailing blanks.shell/semantics.case.escape.quotes: uses echo -n, whose option handling is not portable POSIX echo behavior.shell/semantics.-h.nonposix: set -h and command hash table contents are not a portable shell-script contract.Smoosh test: shell/builtin.kill.jobs
The case expects kill %1 to fail before set -m enables job control. Rush accepts job ID operands for jobs it is already tracking, matching Bash POSIX mode rather than dash. POSIX does not require Rush to hide known job IDs solely because monitor mode is disabled.
POSIX Issue 8 defines loop control in terms of lexically enclosing loops. It explicitly leaves room for unspecified behavior when break or continue is evaluated outside a lexically enclosing loop but another loop is in progress in the same execution environment.
shell/builtin.break.nonlexicalshell/builtin.continue.nonlexicalshell/builtin.dot.breakSeveral Smoosh cases require exact diagnostics or exact non-zero status values where POSIX only requires a diagnostic, a non-zero status, or non-interactive shell abort semantics. Rush should keep the POSIX behavior, but does not need to match Smoosh byte-for-byte.
shell/builtin.command.nospecial: command readonly suppresses special-builtin abort, and Rush reports the readonly failure with non-zero status.shell/builtin.dot.nonexistent: POSIX requires a diagnostic and abort for a non-interactive . failure, not a specific message.shell/builtin.readonly.assign.noninteractive: assigning a readonly variable is fatal in a non-interactive POSIX shell; exact status and text are not normative.shell/builtin.special.redir.error and shell/semantics.redir.close: bad file descriptor redirection failures must diagnose and fail; exact wording and status vary across shells.shell/builtin.times.ioerror: a write failure from times is reported as a utility error; POSIX does not require Smoosh's exact diagnostic or status.shell/builtin.unset: unsetting a readonly variable fails with diagnostic and non-zero status; exact text is not normative.shell/semantics.error.noninteractive: non-interactive expansion errors abort with diagnostic; Smoosh's exact message is not a requirement.shell/semantics.interactive.expansion.exit: an expansion error in an interactive -c command exits non-zero without running the following command; Dash and Bash POSIX mode behave the same.Some Smoosh scripts invoke $TEST_SHELL from inside a test case. The harness applies TEST_SHELL_FLAGS=--posix to the outer test script, but those recursive invocations do not necessarily preserve the same flags. They can therefore exercise Rush default mode during an otherwise POSIX-mode Smoosh run.
shell/parse.eval.error: the inner script runs without --posix; Rush default mode follows Bash by keeping an eval syntax error non-fatal.Smoosh test: shell/semantics.evalorder.fun
The case relies on side effects from ${x=...} while expanding both an assignment word and a redirection word for a function invocation. POSIX specifies the broad ordering of redirections and assignments, but also says it is unspecified whether expansions for words used with assignments or redirections are carried out in the current execution environment or in the command's environment.
Dash and Smoosh choose the redirection-side effect; Bash POSIX and Rush choose the assignment-side effect. Rush should not change POSIX mode solely to match this Smoosh expectation.
Some Smoosh trap cases encode historical or reference-shell behavior around EXIT traps and status propagation. Rush should follow Issue 8 trap and exit rules rather than matching every Smoosh status expectation.
shell/builtin.trap.subshell.false.exitshell/builtin.trap.subshell.loudshell/builtin.trap.subshell.loud2shell/builtin.trap.subshell.true.ec1shell/semantics.return.trapThis page does not classify the trap.chained, async trap, or trap-inheritance cases as compatibility exceptions.
Smoosh test: shell/builtin.trap.exitcode
trap 'set -o bad@option' INT kill -s INT $$
The Smoosh suite expects this script to exit with status 0. Rush should not preserve that result in POSIX mode.
POSIX says a trap action is executed as if by eval action. The action above executes set, which is a special builtin, with an invalid option. POSIX 2.8.1 says a special builtin utility error in a non-interactive shell shall cause the shell to exit.
The trap rule that preserves $? applies after the trap action completes. It does not require restoring the pre-trap status when the action aborts the non-interactive shell.
Expected Rush behavior: write a diagnostic and exit non-zero. If Rush exits 0, treat that as a Rush conformance bug even though it passes this Smoosh test.