Repository navigation
test: extend let readonly diagnostic routing pin with five binding-surface cells (Refs #2641) - #3304
Merged
Merged
Conversation
…-surface cells Measured against the GNU bash 5.3.20 oracle and current master before pinning: comsub capture, function call-site redirect, compound assignment, unquoted operand, and multi-operand shapes all route the readonly diagnostic through the bound fd 2. Refs #2641
caomengxuan666
marked this pull request as ready for review
November 11, 2026 01:26
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.
What this is
A regression-lock extension for the
letreadonly diagnostic routingcovered by #2641. The behavioural repair itself landed with #2968
(squash
d9555905): the arithmetic evaluation-order drain's Readonlyarm now emits through the fd-2-bound diagnostic channel instead of a
raw
eprintln!, and the original twelve-cell pin(
tests/issue2641_let_readonly_redirect.rs) came in with that change.This PR adds five cells to the same pin file, covering binding
surfaces the original cells do not reach. Each shape was measured
against the GNU bash 5.3.20 oracle and against current master before
being pinned:
comsub_capture_redirect—x=$(let "R=2" 2>&1)captures thediagnostic into the substitution value; process stderr stays empty.
function_callsite_redirect— the redirection sits on the functioncall (
f 2>&1), not inside the body.compound_assign_redirect—let "R+=1" 2>&1.unquoted_operand_redirect—let R=2 2>&1.multi_operand_redirect—let "R=2" "3+4" 2>&1: the remainingoperand still evaluates, the status stays 1, one diagnostic.
Evidence
run on the GNU 5.3.20 oracle and on a master
d9555905build:identical stream placement, statuses and values on every shape
(modulo the program-name prefix, which follows the invocation
name).
-D warningson own targets,cargo fmt --check,scripts/check-marker-literals.py, andscripts/check-utf8-boundary-hygiene.shall clean.What this PR deletes
Nothing. It is test-only: one file, +84/−0, no product code, no
existing expectations changed.
Refs #2641