@@ -14,6 +14,69 @@ use cargo_test_support::{
1414
1515use super :: death;
1616
17+ #[ cargo_test( nightly, reason = "requires -Zchecksum-hash-algorithm" ) ]
18+ fn checksum_actually_uses_checksum ( ) {
19+ let p = project ( )
20+ . file ( "src/main.rs" , "mod a; fn main() {}" )
21+ . file ( "src/a.rs" , "" )
22+ . build ( ) ;
23+
24+ p. cargo ( "check -Zchecksum-freshness" )
25+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
26+ . with_stderr_data ( str![ [ r#"
27+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
28+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
29+
30+ "# ] ] )
31+ . run ( ) ;
32+ p. root ( ) . move_into_the_future ( ) ;
33+
34+ p. cargo ( "check -Zchecksum-freshness" )
35+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
36+ . with_stderr_data ( str![ [ r#"
37+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
38+
39+ "# ] ] )
40+ . run ( ) ;
41+ }
42+
43+ #[ cargo_test( nightly, reason = "requires -Zchecksum-hash-algorithm" ) ]
44+ fn same_size_different_content ( ) {
45+ let p = project ( )
46+ . file ( "src/main.rs" , "mod a; fn main() {}" )
47+ . file ( "src/a.rs" , "" )
48+ . build ( ) ;
49+
50+ p. cargo ( "check -Zchecksum-freshness" )
51+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
52+ . with_stderr_data ( str![ [ r#"
53+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
54+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
55+
56+ "# ] ] )
57+ . run ( ) ;
58+ p. change_file ( "src/main.rs" , "mod a;fn main() { }" ) ;
59+
60+ p. cargo ( "check -v -Zchecksum-freshness" )
61+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
62+ . with_stderr_data ( str![ [ r#"
63+ [DIRTY] foo v0.0.1 ([ROOT]/foo): the file `src/main.rs` has changed (checksum didn't match, blake3=26aa07e1adab787246f9d333be65d2eb78dd5fd0fee834ba7a769098b4b651bc != blake3=fc1a42e376d9c148227c13de41b77143f6b5b8132d2b204b63cdbc9326848894)
64+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
65+ [RUNNING] `rustc --crate-name foo [..]
66+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
67+
68+ "# ] ] )
69+ . run ( ) ;
70+
71+ p. cargo ( "check -Zchecksum-freshness" )
72+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
73+ . with_stderr_data ( str![ [ r#"
74+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
75+
76+ "# ] ] )
77+ . run ( ) ;
78+ }
79+
1780#[ cargo_test( nightly, reason = "requires -Zchecksum-hash-algorithm" ) ]
1881fn modifying_and_moving ( ) {
1982 let p = project ( )
0 commit comments