From 3bfe7335232173e18d75da3d6b815fb2fec088ac Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 7 Nov 2024 20:00:03 +0000 Subject: [PATCH] Normalize paths in json mode with and without double backslashes --- src/tools/compiletest/src/runtest.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index bc80c8246ad0f..088c907e13644 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2292,10 +2292,11 @@ impl<'test> TestCx<'test> { let mut normalize_path = |from: &Path, to: &str| { let mut from = from.display().to_string(); + normalized = normalized.replace(&from, to); if json { from = from.replace("\\", "\\\\"); + normalized = normalized.replace(&from, to); } - normalized = normalized.replace(&from, to); }; let parent_dir = self.testpaths.file.parent().unwrap();