Skip to content

test: re-add short_h unit tests + doc bullets (Refs #1597) - #1613

Merged
caomengxuan666 merged 1 commit into
mainfrom
fix/1597-readd-short-h-tests
Nov 13, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
fix/1597-readd-short-h-tests

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Re-add the 3 short_h_is_rejected_like_gnu unit tests (csplit/pathchk/ptx) and the 3 matching //! doc bullets that were held back when #1597 was closed as superseded by #1593.

What was re-added

  • rust2/crates/winux-cmds/src/csplit.rs: 1 test + 1 doc bullet (2 //! lines)
  • rust2/crates/winux-cmds/src/pathchk.rs: 1 test + 1 doc bullet
  • rust2/crates/winux-cmds/src/ptx.rs: 1 test + 1 doc bullet
  • 42 insertions, 0 deletions, 3 files. No product-code change, no workflow change.

Why now

Evidence (X299-2607, Windows)

  • Head (4bcbaf7): cargo test -p winux-cmds short_h_is_rejected_like_gnu -> test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 577 filtered out
  • Base fail-first (6fc5ebf + re-add patch topped up; pre-fix(cmds): reject bare -h for csplit/pathchk/ptx #1593 tree without the product fix): test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 533 filtered out
  • Fresh builds proven: distinct Compiling winux-cmds paths per tree, distinct test-binary sha256 (head 40cbdb41…, base 62197a84…).
  • rustfmt --check rc=0 on all three touched files (head + base).

Notes

本 PR 删除了什么

  • Nothing was deleted. 42 insertions, 0 deletions.

UNVERIFIED-BY-CAPTAIN

Re-add the 3 short_h_is_rejected_like_gnu unit tests and the 3
corresponding //! doc bullets held back when #1597 was closed as
superseded by #1593. The product fix (argopt H_REJECT_SPEC +
rejected_short_h) already landed on master via #1593 (bb489e0);
only the tests + doc bullets were missing. Now that PR #1605
(d2ee03f) runs cargo test -p winux-cmds in CI, these tests will
actually execute.

Refs #1597
@caomengxuan666

Copy link
Copy Markdown
Member Author

Captain review — PASS (WinuxCmd PR #1613, Refs #1597)

Verdict: PASS. Re-add of the 3 short_h unit tests + 3 //! doc bullets held back when #1597 was closed as superseded by #1593.

Merge notes:

  1. The x64 default leg was still running when this verdict was written (PGO rebuild step). It cannot be affected by this PR — only Rust mod tests + //! comments; C++/CMake/packaging untouched, and x64 full + both arm64 legs already pass — but confirm its final conclusion has no new failure name before merging.
  2. Refs-only (Refs fix(cmds): reject bare -h for csplit/pathchk/ptx (WinuxCmd#1591) #1597); fix(cmds): reject bare -h for csplit/pathchk/ptx (WinuxCmd#1591) #1597 stays closed. Merge with the PR body verbatim; verify master HEAD == mergeCommit afterwards.

Full dossier: ~/workspace/review-winx-1597/CAPTAIN-VERIFY.md (§§0–6).

@caomengxuan666

Copy link
Copy Markdown
Member Author

Captain review — PASS (WinuxCmd PR #1613, Refs #1597)

Verdict: PASS. Re-add of the 3 short_h unit tests + 3 //! doc bullets held back when #1597 was closed as superseded by #1593.

Merge notes:

  1. Refs-only (Refs fix(cmds): reject bare -h for csplit/pathchk/ptx (WinuxCmd#1591) #1597); fix(cmds): reject bare -h for csplit/pathchk/ptx (WinuxCmd#1591) #1597 stays closed. Merge with the PR body verbatim; verify master HEAD == mergeCommit afterwards.
  2. Winx master tip is d2ee03f, identical to the PR base — no update-branch needed.

Full dossier: ~/workspace/review-winx-1597/CAPTAIN-VERIFY.md (§§0–6).

@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 13, 2026 08:54
@caomengxuan666
caomengxuan666 merged commit 77a6e51 into main Nov 13, 2026
13 of 15 checks passed
caomengxuan666 added a commit that referenced this pull request Nov 14, 2026
…ixes #1616)

No workflow ever executed rust2/gate/run-gate.sh, so the gate TSV rows
(notably the csplit/pathchk/ptx corpus PR #1613 left out of the ctest
port) had no CI execution path: a green CI proved nothing about the gate.

New rust2-gate job (windows-2025, needs build-windows for the CPP side):
- GNU leg: installs WSL Ubuntu — windows-2025 only enables the WSL
  feature and ships no distro (actions/runner-images#11265); the job
  throws if the distro never comes up, so GNU-vs-MISSING rows can never
  score vacuous green. `wsl --update` failure is non-fatal (403s on
  hosted runners, actions/runner-images#10563) as long as the distro
  registers.
- Rust leg: winuxcmd-driver built --locked from the pinned toolchain
  (RUST_BIN default path, shared registry/toolchain caches).
- CPP leg: Release dispatcher extracted from the x64 runtime package
  artifact, exported as CPP_BIN — the value model the local Debug
  build-vs/usr/bin exe serves; win-mode rows (pathchk 3, ptx 9) keep
  their Rust-vs-CPP comparison.
- Runs the affected-command subset (csplit pathchk ptx, 93 rows: 81
  GNU-gated strict + 12 win) with the ledger uploaded as an artifact;
  the full corpus stays a local/X299 tool.

Verified locally in this worktree: the exact subset invocation
(CPP_BIN=borrowed build-vs exe) exits 0 with pass=81 fail=0 winpass=12
winfail=0 in ~48 s wall.
caomengxuan666 added a commit that referenced this pull request Nov 14, 2026
…1616), find --help/--version double-dash synonyms (#1617) (#1632)

* test(timeout): spawner-level chained-shebang pin, inner script exactly once (Fixes #1595)

The #1595 root cause (resolve_shebang_script's Script arm pushing the
interpreter spelling a second time, duplicating the inner script token
and shifting every later argv token by one) was already removed on main
by PR #1612, together with the unreachable overlong-line guard in
parse_shebang_line. Its pins cover resolve_child's value model only.

This commit adds the spawner-level regression the issue reproduces --
`timeout 5 outer.sh` where outer's interpreter is itself a script --
actually spawning the chain and asserting the script-visible argv:
inner exactly once, tokens not shifted. WSL GNU 5.3 oracle (script-file
probes, target/probe1595): the kernel launch argv [sh, -e, inner, -x,
outer, A, B] surfaces to the script as $0=inner, $1=-x, $2=outer,
$3=A, $4=B; the built driver's timeout produces the same token count
and order (resolved paths per the single-layer convention), rc 5
propagates, and `timeout 5 /bin/sh -c 'echo hi'` exits 0.

* ci(gate): run run-gate.sh on CI — csplit/pathchk/ptx affected subset (Fixes #1616)

No workflow ever executed rust2/gate/run-gate.sh, so the gate TSV rows
(notably the csplit/pathchk/ptx corpus PR #1613 left out of the ctest
port) had no CI execution path: a green CI proved nothing about the gate.

New rust2-gate job (windows-2025, needs build-windows for the CPP side):
- GNU leg: installs WSL Ubuntu — windows-2025 only enables the WSL
  feature and ships no distro (actions/runner-images#11265); the job
  throws if the distro never comes up, so GNU-vs-MISSING rows can never
  score vacuous green. `wsl --update` failure is non-fatal (403s on
  hosted runners, actions/runner-images#10563) as long as the distro
  registers.
- Rust leg: winuxcmd-driver built --locked from the pinned toolchain
  (RUST_BIN default path, shared registry/toolchain caches).
- CPP leg: Release dispatcher extracted from the x64 runtime package
  artifact, exported as CPP_BIN — the value model the local Debug
  build-vs/usr/bin exe serves; win-mode rows (pathchk 3, ptx 9) keep
  their Rust-vs-CPP comparison.
- Runs the affected-command subset (csplit pathchk ptx, 93 rows: 81
  GNU-gated strict + 12 win) with the ledger uploaded as an artifact;
  the full corpus stays a local/X299 tool.

Verified locally in this worktree: the exact subset invocation
(CPP_BIN=borrowed build-vs exe) exits 0 with pass=81 fail=0 winpass=12
winfail=0 in ~48 s wall.

* fix(find): register --help/--version as synonyms acting where they appear (Fixes #1617)

GNU findutils registers both spellings with the same parser (--help is
the synonym of -help, --version of -version; probed GNU findutils 4.9
via script-file probes: `find --help` and `find --version` print to
stdout with rc 0, and they act mid-expression, e.g. `find . --version`).
The shipped dispatcher only matched the single-dash forms, so the
double-dash spellings fell through to the expression parser and were
answered "find: unknown predicate `--help'" with rc 1.

The act-immediately loop now matches both spellings. It also skips
-exec/-execdir/-ok/-okdir bodies up to their ;/+ terminator, the same
consumption rule findutils' own parsers apply: a help spelling inside an
exec body belongs to the executed command, not to find (#1303 — probed
GNU: `find . -name a.txt -exec echo --help \;` prints echo's usage).
That skip is what keeps the #1303 pin green now that --help matches.
This loop's "--" break stays the product's own end-of-options boundary
(GNU's documented -- handling "does not really work" for find; scoped
out of this issue per its fix note).

Known pre-existing edge kept as-is (same behavior the single-dash forms
already had): a help token consumed as a single-argument predicate's
operand (e.g. `-name -help`) still triggers help; GNU would take it as
the pattern. Full arity-aware pre-scanning is a separate question.

Tests: tests/unit/find/find_unit_test.cpp
issue_1617_double_dash_help_version_are_synonyms (usage/version to
stdout rc 0, byte-equal with the single-dash output, acts after a start
point); the #1303 exec-body pin passes unchanged; find.* 159/159 green.

* test(timeout): forward-slash redirect target in the chained-shebang pin (Fixes #1595)

The CI runner's sh is Git-for-Windows (MSYS2): an unquoted backslash
in the redirect word is an escape, so the Windows-spelled argv.out
path landed on a mangled name and the file never appeared — r==5
still held (exit 5 runs regardless), so the failure surfaced as the
read_to_string unwrap NotFound, 702 passed / 1 failed on CI while
passing locally (the local sh family handles backslash paths
verbatim).

Forward slashes are correct for both sh families; no assertion
weakened.
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