From 2e81610f5855b5503249323a8820e91791849629 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sun, 17 May 2026 00:56:14 -0400 Subject: [PATCH] test(windows): normalize EOL in generator drift assertion --- tests/feat-3598-generator-correctness.test.cjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/feat-3598-generator-correctness.test.cjs b/tests/feat-3598-generator-correctness.test.cjs index 5a8c74604..5973a8590 100644 --- a/tests/feat-3598-generator-correctness.test.cjs +++ b/tests/feat-3598-generator-correctness.test.cjs @@ -45,6 +45,10 @@ function sha256(buf) { return crypto.createHash('sha256').update(buf).digest('hex'); } +function normalizeEol(text) { + return String(text).replace(/\r\n/g, '\n'); +} + /** Read a directory recursively into a Map. */ function snapshotDir(dir) { const out = new Map(); @@ -98,7 +102,7 @@ describe('feat-3598: build*Cjs() output matches committed .generated.cjs (stale- assert.equal(typeof fresh, 'string', `${g.exportName}() must return a string`); const committedPath = path.join(REPO_ROOT, g.committed); const committed = fs.readFileSync(committedPath, 'utf-8'); - assert.equal(fresh, committed, + assert.equal(normalizeEol(fresh), normalizeEol(committed), `${g.committed} drifted from generator output — run "cd sdk && npm run gen:${g.script.replace(/^gen-/, '').replace(/\.mjs$/, '')}" to regenerate`); }); }