File tree 2 files changed +5
-11
lines changed
2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -792,16 +792,6 @@ mod tests {
792
792
// the prefix components (e.g. `C:`), there is not way to have a
793
793
// cross-platform stable hash for absolute paths.
794
794
#[ 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]
805
795
fn test_stable_hash ( ) {
806
796
use crate :: util:: StableHasher ;
807
797
use std:: path:: Path ;
@@ -817,6 +807,10 @@ mod tests {
817
807
hasher. finish ( )
818
808
} ;
819
809
810
+ let source_id = SourceId :: crates_io ( & GlobalContext :: default ( ) . unwrap ( ) ) . unwrap ( ) ;
811
+ assert_eq ! ( gen_hash( source_id) , 14747226178473219715 ) ;
812
+ assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "83d63c3e13aca8cc" ) ;
813
+
820
814
let url = "https://my-crates.io" . into_url ( ) . unwrap ( ) ;
821
815
let source_id = SourceId :: for_registry ( & url) . unwrap ( ) ;
822
816
assert_eq ! ( gen_hash( source_id) , 2056262832525457700 ) ;
Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ fn short_name(id: SourceId, is_shallow: bool) -> String {
456
456
// CAUTION: This should not change between versions. If you change how
457
457
// this is computed, it will orphan previously cached data, forcing the
458
458
// 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
460
460
// a similar discussion.
461
461
let hash = hex:: short_hash ( & id) ;
462
462
let ident = id. url ( ) . host_str ( ) . unwrap_or ( "" ) . to_string ( ) ;
You can’t perform that action at this time.
0 commit comments