test(rustc): Show the bug

This commit is contained in:
Ed Page 2025-05-06 11:05:10 -05:00
parent 33d7b0aa92
commit 02ec8d48e5

View File

@ -533,6 +533,29 @@ fn fail_with_multiple_packages() {
.run();
}
#[cargo_test]
fn fail_with_bad_bin_no_package() {
let p = project()
.file(
"src/main.rs",
r#"
fn main() { println!("hello a.rs"); }
"#,
)
.build();
p.cargo("rustc --bin main")
.with_status(101)
.with_stderr_data(str![[r#"
thread 'main' panicked [..]:
The number of packages must be at least 1
...
"#]])
.run();
}
#[cargo_test]
fn fail_with_glob() {
let p = project()