Skip to content

Commit

Permalink
Add metadata test for invalid publish field
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimartino committed Sep 20, 2022
1 parent 7a50c0c commit 7b16e59
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testsuite/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,30 @@ Caused by:
.run();
}

#[cargo_test]
fn cargo_metadata_with_invalid_publish_field() {
let p = project()
.file("src/foo.rs", "")
.file(
"Cargo.toml",
r#"
[package]
publish = "foo"
"#,
)
.build();

p.cargo("metadata")
.with_status(101)
.with_stderr(
r#"[ERROR] failed to parse manifest at `[..]`
Caused by:
invalid type: string "foo", expected a boolean or vector of strings for key `package.publish`"#,
)
.run();
}

const MANIFEST_OUTPUT: &str = r#"
{
"packages": [{
Expand Down

0 comments on commit 7b16e59

Please sign in to comment.