Skip to content

test: align the issue3833 pin's ! in expectation with GNU (Refs #3833) - #3916

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/3833-pin-gnu-align
Nov 18, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/3833-pin-gnu-align

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

结论:钉错,不是产品错(队长裁定)

现尖 census 里 issue3833_bang_reserved_words 的 already_correct_and_non_reserved_shapes_stay_unchanged 红,失败点是其中的 ! in 形:钉期望 rc 0「command not found」,产品(#3901 合入后)给 rc 2 syntax error near unexpected token \in'`。

以 GNU bash 5.3.20 oracle 实测裁定(2026-11-18):

形 GNU
! in rc 2,syntax error near unexpected token in'
in(裸) rc 2,同上
echo hi | in a rc 2,同上
! ] / ! { / ! } / ! ) 与钉现期望一致

即 in 在任何命令位置都被文法拒绝(命令文法没有以 IN 起始的产生式)——#3901 的行为是对的,钉把修前产品行为(正是 #3628 的缺陷本身)写成了期望。#3833 立钉时该形被误分到「非保留字不变」组。

改动

仅测试文件:! in 从「不变组」移入保留字循环(assert_reserved_error("! in", "in", 1)),删错误断言块,附裁定注释。无产品代码变更。fail-first 即现尖 census 的红格本身(旧钉在现产品上必红);本 PR 头 census 应见该茎转绿。

Refs #3833(单已关,此为其钉的期望对齐);关联 #3901 / #3628。

The pin asserted `! in` -> rc 0 'command not found'. GNU bash 5.3.20
rejects `in` at any command position (bare, after `!`, after `|`)
with rc 2 'syntax error near unexpected token `in'\'', because the
command grammar has no production starting with the IN token. The
old expectation encoded the pre-#3901 product behaviour, which was
itself the #3628 defect; #3901's fix exposed the stale cell on the
master-tip census. Move `! in` into the reserved-word loop and drop
the wrong block. Oracle-verified 2026-11-18; no product code changes.
caomengxuan666 added a commit that referenced this pull request Nov 18, 2026
…(rubash#3892)

队长复核 PASS 并合入(合并形态验证)。

修法:apply_dynamic_fd_var_redirects 按列表序把 heredoc_redirects 与 cmd.redirects 配对走,在第一个失败的非 {var} 重定向处停(non_fd_var_redirect_fails_at 前沿判定),{var} 条目在失败点之前者存活、之后者永不绑定——对齐 GNU do_redirections + undo_partial_redirects(redir.c:237 有序走);exec 被拒时同样不回滚已绑定的 {var}。

验证:原头 CI 裁清(census 81、新钉 10 PASS、goldens 基线二名、CLI 唯一红为旧基线上的 #3905 格)。因与 #3898 同触 trap_exec.rs,走了 update-branch 合并形态重跑:合并形态 census 79,与现尖 census 逐名对比零新增(issue2883 一格首跑翻红、重跑转绿,裁 census 抖动;issue3833 红为钉期望错误,与本 PR 无关,另由 #3916 对齐);CLI 仅 coproc 具名 fd 抖动格;goldens 基线二名;Rust tests 全绿。新钉 issue3892 与兄弟面 issue3893 在合并形态 census 中均 PASS。

本 PR 删除了什么:
- trap_exec.rs 内 apply_dynamic_fd_var_redirects 的旧无序应用路径被前沿语义实现替换(+323/−56 的净变更含新判定函数);redirection.rs 一行签名调整;未删除任何文件或测试。
@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 18, 2026 14:58
@caomengxuan666
caomengxuan666 merged commit e39c44d into master Nov 18, 2026
8 of 12 checks passed
caomengxuan666 added a commit that referenced this pull request Nov 18, 2026
## 根因

{var}<< heredoc 须在列表位置绑定(GNU redir.c:237 有序遍历);修法本体在原提交 307782b(pipeline_exec / execution_misc / redirections 等 8 文件),队长待改复核时仅剩一格钉红。

## 续作(本轮唯一改动)

`unterminated_varassign_heredoc_still_warns` 钉期望错、产品对:未终结 heredoc 吞掉文件剩余全部内容作体,后续 `echo "v=$v"` 行本身不存在于命令流中,stdout 应为空(GNU 5.3.20 oracle 实测:stdout 空、stderr 警告、rc 0;锚点 redir.c:963-968 / :1470 / :423)。只改钉(test-only +12/-1:stdout 断言 "v=\n"→"",保留 stderr 警告与 rc==0 断言,附 oracle 证据注释),产品代码未动。原钉系从已终结变体复制期望。

## 队长复核(2026-11-19 00:3x)

头 CI 逐名裁定(新头 da03356,run 44344314375):census 77,自带钉 12/12 绿,零新增 vs #3920/#3916 头(78;少 1 格为 issue1902 抖动格);goldens 基线二名(232 passed);issue1903 本轮 ok 未复现(时序抖动);CLI 仅 coproc 抖动格;Rust tests 绿,macOS job cancelled 且 steps 为空(从未运行,非产品红);darwin cross-target 同为 cancelled 且 steps 为空(从未运行,非产品红);ledger、交叉编译 linux/android、shell 功能、Windows 编译、niu-build 全绿。分支基底即现尖 47a24b2,无需 update-branch。

说明:本钉为行为锁定钉(产品在修前已合 GNU 值),非 fail-first 守卫钉;fail-first 不适用于本次 test-only 对齐。服务器腿(钉 stem 服务器复跑、lib 对齐、-D warnings、全量 rustfmt)因链路中断未跑,待恢复后补跑;产品面无改动,lib 不可能因此移动,census 即其证据。

Refs #3894。

本 PR 删除了什么:
未删除任何文件、函数、公开面或测试。产品修法见原提交;续作仅修改一处测试期望值。
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.

1 participant