From b22c5075d3e6bd03826dba9c5d944bb52d07ef8e Mon Sep 17 00:00:00 2001 From: Raushan Kumar Date: Fri, 13 Feb 2026 20:00:13 +0000 Subject: [PATCH] feat: add test case for `verify-project` with invalid TOML syntax in `Cargo.toml` --- tests/testsuite/verify_project.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/testsuite/verify_project.rs b/tests/testsuite/verify_project.rs index 3864072e2f3..778c54fe8cf 100644 --- a/tests/testsuite/verify_project.rs +++ b/tests/testsuite/verify_project.rs @@ -83,3 +83,25 @@ fn cargo_verify_project_honours_unstable_features() { "#]]) .run(); } + +#[cargo_test] +fn verify_project_invalid_toml_syntax() { + let p = project() + .file( + "Cargo.toml", + r#" +[package] +name = "foo" +version = "#, + ) + .file("src/lib.rs", "") + .build(); + + p.cargo("verify-project") + .with_status(1) + .with_stdout_data(str![[r#" +{"invalid":"TOML parse error at line 4, column 11/n |/n4 | version = /n | ^/nstring values must be quoted, expected literal string/n"} + +"#]]) + .run(); +}