Skip to content

Commit 092781c

Browse files
committed
Compress two tests into one
1 parent f34b086 commit 092781c

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

tests/testsuite/build.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4991,29 +4991,20 @@ fn reduced_reproduction_8249() {
49914991
}
49924992

49934993
#[cargo_test]
4994-
fn target_directory_is_excluded_from_backups() {
4994+
fn target_directory_backup_exclusion() {
49954995
let p = project()
49964996
.file("Cargo.toml", &basic_bin_manifest("foo"))
49974997
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
49984998
.build();
49994999

5000+
// Newly created target/ should have CACHEDIR.TAG inside...
50005001
p.cargo("build").run();
50015002
let cachedir_tag = p.build_dir().join("CACHEDIR.TAG");
50025003
assert!(cachedir_tag.is_file());
50035004
assert!(fs::read_to_string(&cachedir_tag)
50045005
.unwrap()
50055006
.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.
50175008
fs::remove_file(&cachedir_tag).unwrap();
50185009
p.cargo("build").run();
50195010
assert!(!&cachedir_tag.is_file());

0 commit comments

Comments
 (0)