Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Jun 20, 2024
1 parent 3c7d764 commit 9c6624d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cargo/core/source_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ mod tests {
#[cfg(not(windows))]
let ws_root = Path::new("/tmp/ws");
#[cfg(windows)]
let ws_root = Path::new(r"C:\tmp\ws");
let ws_root = Path::new(r"C:\\tmp\ws");

let gen_hash = |source_id: SourceId| {
let mut hasher = StableHasher::new();
Expand Down Expand Up @@ -837,8 +837,12 @@ mod tests {
assert_eq!(crate::util::hex::short_hash(&source_id), "1d5b66d8000a272b");

let path = &ws_root.join("crate");
eprintln!("{path:?}");
eprintln!("{ws_root:?}");
let source_id = SourceId::for_local_registry(path).unwrap();
eprintln!("{}", source_id.url());
assert_eq!(gen_hash(source_id), 17171351456028149232);
dbg!(dbg!(source_id.url().to_file_path().unwrap()).strip_prefix(ws_root));
assert_eq!(crate::util::hex::short_hash(&source_id), "f0c5f1e92be54cee");

let source_id = SourceId::for_path(path).unwrap();
Expand Down

0 comments on commit 9c6624d

Please sign in to comment.