From 0470e4e8502888c894138a6e8667756f18200eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 23 Oct 2026 18:54:32 +0200 Subject: [PATCH] test(guards): read the stripper parity sweep through the shared source index A test that reads source by path counts against the realism ratchet; the sweep reads every file through readSourceText like the other guards, which also shares the reads with them. --- src/__tests__/strip-comments-parity.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/__tests__/strip-comments-parity.test.ts b/src/__tests__/strip-comments-parity.test.ts index 52c94755b..99067de43 100644 --- a/src/__tests__/strip-comments-parity.test.ts +++ b/src/__tests__/strip-comments-parity.test.ts @@ -9,13 +9,13 @@ * scanner held to the TypeScript parser: every source file is stripped both * ways, and the first file where they differ fails here with the line. */ -import { readFileSync } from "node:fs"; import { join } from "node:path"; import ts from "typescript"; import { describe, expect, it } from "vitest"; import { + readSourceText, requireFloor, stripComments, walkSourceFiles, @@ -117,7 +117,7 @@ describe("stripComments", () => { ); const differing: string[] = []; for (const rel of files) { - const text = readFileSync(join(ROOT, rel), "utf8"); + const text = readSourceText(join(ROOT, rel)); const ours = lines(stripComments(text, rel)); const parser = lines(parserStrip(text, rel)); const at = ours.findIndex((line, index) => line !== parser[index]);