Smoosh suite notes

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.

Expected failures

Non-POSIX extensions

Rush does not need to match Smoosh expectations for extension features that POSIX does not require in sh.

Job ID operands with monitor mode disabled

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.

Unspecified non-lexical loop control

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.

Diagnostic wording and exact status details

Several 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.

Recursive shell invocations that do not preserve mode flags

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.

Function assignment and redirection expansion order

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.

Trap status cases where Smoosh is not the POSIX oracle

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.

This page does not classify the trap.chained, async trap, or trap-inheritance cases as compatibility exceptions.

Trap exit status after a special builtin error

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.