Skip to content

Pin contract-view and UAT expectations to LF (fix Windows contract-view-tests red) - #1887

Merged
ehartford merged 1 commit into
withlang-dev:mainfrom
joshhickson:josh/test-fixtures-eol-lf
Oct 2, 2026
Merged

ehartford merged 1 commit into
withlang-dev:mainfrom
joshhickson:josh/test-fixtures-eol-lf

Conversation

@joshhickson

Copy link
Copy Markdown
Contributor

contract-view-tests compares each test/contract/*.w's contract view with its .expected file byte for byte, and
uat-tests compares the UAT runner's report and listing with test/uat/expected*.txt the same way. Under
core.autocrlf=true (Git for Windows' default, and GitHub's Windows runners') a native checkout rewrites those files
to CRLF, while the outputs are LF, so every line differs. The committed blobs are LF (git ls-files --eol shows
i/lf w/crlf attr/).

This pins them to LF, as #801 and #942 did for the embed_file fixtures and the .w sources. The change is 10 lines
of .gitattributes, and no committed file changes.

Evidence (native windows-x86_64, Git for Windows with core.autocrlf=true, the pinned seed
nightly-20260926-local-1-2e8defaa18ef, main 9ee1234f):

Before (main) After (this commit, fixtures checked out again)
contract-view-tests red: all 6 .expected files differ (CR on every line) green
uat-tests red: the report and the listing differ on every line still red, but only on the two lines below, for reasons of its own
src/main build :gate green (the fixed list; this worktree had no battery measurements)

Not in this PR, for your information. Both of these are still red on windows-x86_64 after this change:

  • uat-tests, two Windows-specific differences:
    • the verbs scenario's step run: ./out/bin/tmp exits -2: the program is tmp.exe;
    • skip_platform prints (platforms: windows not listed) where expected-list.txt has <host>.
  • native-spec-tests: test/spec/spec_ss14_11_await_combinator_cancel_joins.w carries known-issue: #916, but it
    passes on windows-x86_64, so the known-issue gate reports "expected this test to stay red, but it passed". It's
    already skipped on linux-aarch64 for the same reason.

A full battery wasn't run, because the change only affects how two test groups' fixtures are checked out. Both groups
were run before and after, and the gate was run.

…ew-tests red)

contract-view-tests compares each test/contract/*.w's contract view with its
.expected file byte for byte, and uat-tests compares the UAT runner's report
and listing with test/uat/expected*.txt the same way. Under core.autocrlf=true
(Git for Windows' default, and GitHub's Windows runners') a native checkout
rewrites those files to CRLF, while the outputs are LF, so every line differs.
On main 9ee1234, windows-x86_64: contract-view-tests fails on all six
.expected files, and uat-tests fails on both comparisons, CR on every line.

Pin them to LF, as withlang-dev#801 and withlang-dev#942 did for the embed_file fixtures and the .w
sources. With this change contract-view-tests is green. uat-tests is still red
on Windows for two reasons of its own (the verbs scenario's
`run: ./out/bin/tmp` exits -2, and skip_platform prints `windows` where the
listing expects `<host>`), but its report and listing no longer differ on
line endings.

@ehartford ehartford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed on a worktree at the PR head, driven by the pinned seed.

Root cause confirmed: the checkout, not the compiler. The compared outputs are raw WriteFile on Windows (rt/windows_x86_64.w:507, rt/windows_aarch64.w:388) — LF on every host; the committed goldens are LF (git ls-files --eol: i/lf); only a core.autocrlf=true checkout turns them CRLF because they carried no attribute. Same mechanism and same fix as the existing pins for test/behavior/*.txt (#801). The byte-for-byte comparison in build.w stays strict; no program or golden blob changes.

Reproduced the red on the Mac by checking test/contract and test/uat out as CRLF (w/crlf confirmed): :contract-view-tests red on all 6 ok_*.expected, :uat-tests red on report and listing; every differing byte is a \r. With the PR's pin, re-checked out (w/lf): both green. test/uat/**/*.txt matches test/uat/expected.txt directly (git check-attr: eol lf).

Leaving *.uat unpinned is right — src/Uat.w:78-81,162-163 strip CR per line by design.

Gate on the PR tree: red only on unit-return-review for lib/std/c_algorithms/defs.w:272 (extern fn … -> Unit) — that line is in the PR's base (9ee1234) and is gone on main; the PR touches only .gitattributes. Everything else on the fixed list passed. Needs a rebase onto main (34 behind) before the stack's battery.

The two remaining Windows-only uat-tests diffs you describe (tmp.exe, the <host> listing line) are outside this PR and look like real defects — worth their own issues.

@ehartford
ehartford marked this pull request as ready for review October 2, 2026 06:21
@ehartford
ehartford merged commit e82cfb5 into withlang-dev:main Oct 2, 2026
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.

2 participants