Skip to content

Commit 7662c2d

Browse files
author
Stefan Hoelzl
committed
added dotfile to include test
got rid of extra test for dotfiles
1 parent 60db94c commit 7662c2d

File tree

1 file changed

+3
-55
lines changed

1 file changed

+3
-55
lines changed

tests/testsuite/package.rs

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,12 @@ fn include() {
425425
version = "0.0.1"
426426
authors = []
427427
exclude = ["*.txt"]
428-
include = ["foo.txt", "**/*.rs", "Cargo.toml"]
428+
include = ["foo.txt", "**/*.rs", "Cargo.toml", ".dotfile"]
429429
"#,
430430
)
431431
.file("foo.txt", "")
432432
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
433+
.file(".dotfile", "")
433434
// Should be ignored when packaging.
434435
.file("src/bar.txt", "")
435436
.build();
@@ -442,6 +443,7 @@ fn include() {
442443
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
443444
[WARNING] both package.include and package.exclude are specified; the exclude list will be ignored
444445
[PACKAGING] foo v0.0.1 ([..])
446+
[ARCHIVING] .dotfile
445447
[ARCHIVING] Cargo.toml
446448
[ARCHIVING] foo.txt
447449
[ARCHIVING] src/main.rs
@@ -1420,57 +1422,3 @@ fn gitignore_negate() {
14201422
",
14211423
);
14221424
}
1423-
1424-
#[cargo_test]
1425-
fn include_dotfile() {
1426-
let p = project()
1427-
.file(
1428-
"Cargo.toml",
1429-
r#"
1430-
[project]
1431-
name = "foo"
1432-
version = "0.0.1"
1433-
"#,
1434-
)
1435-
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
1436-
.file(".hidden", "") // should be included when packaging
1437-
.build();
1438-
1439-
p.cargo("package")
1440-
.with_stderr(
1441-
"\
1442-
[WARNING] manifest has no [..]
1443-
See [..]
1444-
[PACKAGING] foo v0.0.1 ([CWD])
1445-
[VERIFYING] foo v0.0.1 ([CWD])
1446-
[COMPILING] foo v0.0.1 ([CWD][..])
1447-
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
1448-
",
1449-
)
1450-
.run();
1451-
assert!(p.root().join("target/package/foo-0.0.1.crate").is_file());
1452-
p.cargo("package -l")
1453-
.with_stdout(
1454-
"\
1455-
.hidden
1456-
Cargo.lock
1457-
Cargo.toml
1458-
src/main.rs
1459-
",
1460-
)
1461-
.run();
1462-
1463-
let f = File::open(&p.root().join("target/package/foo-0.0.1.crate")).unwrap();
1464-
validate_crate_contents(
1465-
f,
1466-
"foo-0.0.1.crate",
1467-
&[
1468-
".hidden",
1469-
"Cargo.lock",
1470-
"Cargo.toml",
1471-
"Cargo.toml.orig",
1472-
"src/main.rs",
1473-
],
1474-
&[],
1475-
);
1476-
}

0 commit comments

Comments
 (0)