Skip to content

Commit 5acc7d0

Browse files
committed
refactor(source_id): merge stable hash tests into one
1 parent 494571a commit 5acc7d0

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

src/cargo/core/source_id.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -792,16 +792,6 @@ mod tests {
792792
// the prefix components (e.g. `C:`), there is not way to have a
793793
// cross-platform stable hash for absolute paths.
794794
#[test]
795-
fn test_cratesio_hash() {
796-
let gctx = GlobalContext::default().unwrap();
797-
let crates_io = SourceId::crates_io(&gctx).unwrap();
798-
assert_eq!(crate::util::hex::short_hash(&crates_io), "83d63c3e13aca8cc");
799-
}
800-
801-
// See the comment in `test_cratesio_hash`.
802-
//
803-
// Only test on non-Windows as paths on Windows will get different hashes.
804-
#[test]
805795
fn test_stable_hash() {
806796
use std::hash::Hasher;
807797
use std::path::Path;

src/cargo/sources/registry/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ fn short_name(id: SourceId, is_shallow: bool) -> String {
456456
// CAUTION: This should not change between versions. If you change how
457457
// this is computed, it will orphan previously cached data, forcing the
458458
// cache to be rebuilt and potentially wasting significant disk space. If
459-
// you change it, be cautious of the impact. See `test_cratesio_hash` for
459+
// you change it, be cautious of the impact. See `test_stable_hash` for
460460
// a similar discussion.
461461
let hash = hex::short_hash(&id);
462462
let ident = id.url().host_str().unwrap_or("").to_string();

0 commit comments

Comments
 (0)