File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -4989,3 +4989,32 @@ fn reduced_reproduction_8249() {
4989
4989
p. cargo ( "check" ) . run ( ) ;
4990
4990
p. cargo ( "check" ) . run ( ) ;
4991
4991
}
4992
+
4993
+ #[ cargo_test]
4994
+ fn target_directory_is_excluded_from_backups ( ) {
4995
+ let p = project ( )
4996
+ . file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
4997
+ . file ( "src/foo.rs" , & main_file ( r#""i am foo""# , & [ ] ) )
4998
+ . build ( ) ;
4999
+
5000
+ p. cargo ( "build" ) . run ( ) ;
5001
+ let cachedir_tag = p. target_debug_dir ( ) . join ( "CACHEDIR.TAG" ) ;
5002
+ assert ! ( cachedir_tag. is_file( ) ) ;
5003
+ assert ! ( fs:: read_to_string( & cachedir_tag)
5004
+ . unwrap( )
5005
+ . 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. target_debug_dir ( ) . join ( "CACHEDIR.TAG" ) ;
5016
+ p. cargo ( "build" ) . run ( ) ;
5017
+ fs:: remove_file ( & cachedir_tag) . unwrap ( ) ;
5018
+ p. cargo ( "build" ) . run ( ) ;
5019
+ assert ! ( !& cachedir_tag. is_file( ) ) ;
5020
+ }
You can’t perform that action at this time.
0 commit comments