Skip to content

Commit

Permalink
debugging snapshot info Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Feb 28, 2024
1 parent 4d5145c commit 4a37b50
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ pub fn run_and_format<'a>(
String::from_utf8_lossy(&output.stderr)
);

println!("<DEBUG>{snapshot}</DEBUG>");

for (matcher, replacement) in filters.as_ref() {
// TODO(konstin): Cache regex compilation
let re = Regex::new(matcher).expect("Do you need to regex::escape your filter?");
Expand Down Expand Up @@ -364,6 +366,8 @@ pub fn run_and_format<'a>(
}
}

println!("<DEBUG-replaced>{snapshot}</DEBUG-replaced>");

(snapshot, output)
}

Expand Down
21 changes: 11 additions & 10 deletions crates/uv/tests/pip_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,18 +521,19 @@ fn format_json() -> Result<()> {
let replace_whitespace = " ".repeat(57);

let search_workspace = workspace_dir.as_str().strip_prefix(prefix).unwrap();
let search_workspace_escaped = search_workspace.replace('/', "\\\\");
let replace_workspace = "[WORKSPACE_DIR]/";

let filters = INSTA_FILTERS
.iter()
.copied()
.chain(vec![
(search_workspace, replace_workspace),
(find_divider.as_str(), replace_divider.as_str()),
(find_header.as_str(), replace_header.as_str()),
(find_whitespace.as_str(), replace_whitespace.as_str()),
])
.collect::<Vec<_>>();
let filters: Vec<_> = [
(search_workspace, replace_workspace),
(search_workspace_escaped.as_str(), replace_workspace),
(find_divider.as_str(), replace_divider.as_str()),
(find_header.as_str(), replace_header.as_str()),
(find_whitespace.as_str(), replace_whitespace.as_str())
]
.into_iter()
.chain(INSTA_FILTERS.to_vec())
.collect();

uv_snapshot!(filters, Command::new(get_bin())
.arg("pip")
Expand Down

0 comments on commit 4a37b50

Please sign in to comment.