File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -4991,29 +4991,20 @@ fn reduced_reproduction_8249() {
4991
4991
}
4992
4992
4993
4993
#[ cargo_test]
4994
- fn target_directory_is_excluded_from_backups ( ) {
4994
+ fn target_directory_backup_exclusion ( ) {
4995
4995
let p = project ( )
4996
4996
. file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
4997
4997
. file ( "src/foo.rs" , & main_file ( r#""i am foo""# , & [ ] ) )
4998
4998
. build ( ) ;
4999
4999
5000
+ // Newly created target/ should have CACHEDIR.TAG inside...
5000
5001
p. cargo ( "build" ) . run ( ) ;
5001
5002
let cachedir_tag = p. build_dir ( ) . join ( "CACHEDIR.TAG" ) ;
5002
5003
assert ! ( cachedir_tag. is_file( ) ) ;
5003
5004
assert ! ( fs:: read_to_string( & cachedir_tag)
5004
5005
. unwrap( )
5005
5006
. starts_with( "Signature: 8a477f597d28d172789f06886806bc55" ) ) ;
5006
- }
5007
-
5008
- #[ cargo_test]
5009
- fn target_directory_is_not_excluded_from_backups_if_it_already_exists ( ) {
5010
- let p = project ( )
5011
- . file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
5012
- . file ( "src/foo.rs" , & main_file ( r#""i am foo""# , & [ ] ) )
5013
- . build ( ) ;
5014
-
5015
- let cachedir_tag = p. build_dir ( ) . join ( "CACHEDIR.TAG" ) ;
5016
- p. cargo ( "build" ) . run ( ) ;
5007
+ // ...but if target/ already exists CACHEDIR.TAG should not be created in it.
5017
5008
fs:: remove_file ( & cachedir_tag) . unwrap ( ) ;
5018
5009
p. cargo ( "build" ) . run ( ) ;
5019
5010
assert ! ( !& cachedir_tag. is_file( ) ) ;
You can’t perform that action at this time.
0 commit comments