From ec02fe875a48f549475a5cf23beb4b467811ea5d Mon Sep 17 00:00:00 2001 From: camc314 <18101008+camc314@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:58:34 +0000 Subject: [PATCH] fix(oxlint): normalize path separators in snapshot tests (#14406) Passing CI: https://github.com/oxc-project/oxc/actions/runs/18308879096/job/52132542984 --- apps/oxlint/test/utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/oxlint/test/utils.ts b/apps/oxlint/test/utils.ts index 41ab6bf537b2b..274a9abd8f968 100644 --- a/apps/oxlint/test/utils.ts +++ b/apps/oxlint/test/utils.ts @@ -92,10 +92,12 @@ function normalizeStdout(stdout: string): string { match = line.match(/^(\s*\|\s+File path: )(.+)$/); if (match) { const [, preamble, path] = match; - if (path.startsWith(REPO_ROOT_PATH)) return [`${preamble}/${path.slice(REPO_ROOT_PATH.length)}`]; + if (path.startsWith(REPO_ROOT_PATH)) { + return [`${preamble}/${path.slice(REPO_ROOT_PATH.length).replace(/\\/g, '/')}`]; + } } } - if (line.startsWith(REPO_ROOT_PATH)) line = `/${line.slice(REPO_ROOT_PATH.length)}`; + if (line.startsWith(REPO_ROOT_PATH)) line = `/${line.slice(REPO_ROOT_PATH.length).replace(/\\/g, '/')}`; return [line]; });