Skip to content

Commit 4242406

Browse files
committed
Add test to confirm that Cargo.toml.orig files are reserved.
1 parent e4c7251 commit 4242406

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/testsuite/package.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,45 @@ in package source
283283
.run();
284284
}
285285

286+
#[cargo_test]
287+
fn orig_file_collision() {
288+
let p = project().build();
289+
let _ = git::repo(&paths::root().join("foo"))
290+
.file(
291+
"Cargo.toml",
292+
r#"
293+
[project]
294+
name = "foo"
295+
description = "foo"
296+
version = "0.0.1"
297+
authors = []
298+
license = "MIT"
299+
documentation = "foo"
300+
homepage = "foo"
301+
repository = "foo"
302+
exclude = ["*.no-existe"]
303+
"#,
304+
)
305+
.file(
306+
"src/main.rs",
307+
r#"
308+
fn main() {}
309+
"#,
310+
)
311+
.file("Cargo.toml.orig", "oops")
312+
.build();
313+
p.cargo("package")
314+
.arg("--no-verify")
315+
.with_status(101)
316+
.with_stderr(
317+
"\
318+
[ERROR] invalid inclusion of reserved file name Cargo.toml.orig \
319+
in package source
320+
",
321+
)
322+
.run();
323+
}
324+
286325
#[cargo_test]
287326
fn path_dependency_no_version() {
288327
let p = project()

0 commit comments

Comments
 (0)