Skip to content

test(#731): CRLF scripts are a two-layer contract - windows #140 tolerance, unix GNU parity - #801

Merged
caomengxuan666 merged 1 commit into
masterfrom
decision/731-crlf-two-layer-contract
Oct 18, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
decision/731-crlf-two-layer-contract

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Closes #731 (the decision, implemented).

The two issue106 CRLF tests encoded one behavior for both platforms; each platform ships a different contract (windows: #140 tolerance, cfg-gated, because the shipped bundle is 100% CRLF; unix: byte-exact GNU). The tests now pin each platform's own contract via a cfg! branch, with the WSL-verified GNU bytes (rc 2 + syntax error; heredoc keeps '\r') recorded in the file and on #731. The issue's premise that rubash 'matches GNU byte-for-byte today' only described the unix build.

…rance, unix GNU parity

The two issue106 CRLF tests encoded ONE behavior for both platforms and
contradicted whichever platform ran the other contract: on windows the
#140 product tolerance (trailing '\r' stripped before lexing/heredoc
bodies - the shipped oh-my-niu bundle is 100% CRLF) makes them green,
while the unix lane's GNU-faithful reader makes them red - and the
#731 body's premise ('rubash matches GNU byte-for-byte today') only
held for the unix build.

Ruling recorded on #731: each platform pins its OWN shipped contract.
windows asserts the tolerant bytes (rc 0, compound-ok, clean heredoc);
unix asserts the GNU bytes (WSL 5.3.0 verified: rc 2 + 'syntax error
near unexpected end of file from `if' command', empty stdout; heredoc
body and trailing words keep the '\r'). A strict-parity opt-in on
windows remains a future enhancement, never a default flip.
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.

[decision] CRLF script tolerance vs GNU parity (issue106 tests)

1 participant