From 9c6624d55e811593e6ad9cd79432c6f1eb787579 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Thu, 20 Jun 2024 10:16:29 -0400 Subject: [PATCH] WIP --- src/cargo/core/source_id.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/source_id.rs b/src/cargo/core/source_id.rs index 68f916b36b5a..53ccd9782d68 100644 --- a/src/cargo/core/source_id.rs +++ b/src/cargo/core/source_id.rs @@ -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(); @@ -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();