Skip to content

Commit

Permalink
Normalize paths in json mode with and without double backslashes
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Nov 7, 2024
1 parent 8544742 commit 3bfe733
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3bfe733

Please sign in to comment.