diff --git a/tests/wire-contract-golden.test.ts b/tests/wire-contract-golden.test.ts index 1dd195d1a..b1cc51c5d 100644 --- a/tests/wire-contract-golden.test.ts +++ b/tests/wire-contract-golden.test.ts @@ -1,8 +1,12 @@ // Golden schema snapshots (#1304 item 2). Every tool schema bili or the pinned -// kernel advertises on any wire has a committed byte-exact snapshot under -// tests/golden/wire-contract/. Any schema change turns these red; regeneration -// (node --import tsx scripts/update-wire-contract-goldens.ts) is only valid -// with justification in the PR body — silent drift is what #1299 was. +// kernel advertises on any wire has a committed snapshot under +// tests/golden/wire-contract/. Comparison is byte-exact on canonical LF text: +// disk content is normalized \r\n → \n first because Windows CI checkouts +// apply autocrlf and materialize committed-LF goldens as CRLF in the worktree +// (first-run failure on windows-latest, run 36102348905). Any schema change +// turns these red; regeneration (node --import tsx +// scripts/update-wire-contract-goldens.ts) is only valid with justification in +// the PR body — silent drift is what #1299 was. import test from "node:test"; import assert from "node:assert/strict"; @@ -20,8 +24,8 @@ test("wire-contract goldens: no orphaned snapshot files", () => { }); for (const spec of buildGoldens()) { - test(`wire-contract goldens: ${spec.name} (${spec.layer}) matches committed snapshot byte-for-byte`, () => { - const expected = fs.readFileSync(path.join(GOLDEN_DIR, spec.name), "utf8"); + test(`wire-contract goldens: ${spec.name} (${spec.layer}) matches committed snapshot`, () => { + const expected = fs.readFileSync(path.join(GOLDEN_DIR, spec.name), "utf8").replace(/\r\n/g, "\n"); const actual = canonicalize(spec.build()); assert.equal( actual,