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.
This commit is contained in:
Marc-André Bombeck committed 2026-10-23 18:54:32 +02:00
1 parent 4748091636
commit 0470e4e850
1 file changed
+2 -2
+2 -2
View File
@@ -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]);