Skip to content

Commit 02ec8d4

Browse files
committed
test(rustc): Show the bug
1 parent 33d7b0a commit 02ec8d4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/testsuite/rustc.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,29 @@ fn fail_with_multiple_packages() {
533533
.run();
534534
}
535535

536+
#[cargo_test]
537+
fn fail_with_bad_bin_no_package() {
538+
let p = project()
539+
.file(
540+
"src/main.rs",
541+
r#"
542+
fn main() { println!("hello a.rs"); }
543+
"#,
544+
)
545+
.build();
546+
547+
p.cargo("rustc --bin main")
548+
.with_status(101)
549+
.with_stderr_data(str![[r#"
550+
551+
thread 'main' panicked [..]:
552+
The number of packages must be at least 1
553+
...
554+
555+
"#]])
556+
.run();
557+
}
558+
536559
#[cargo_test]
537560
fn fail_with_glob() {
538561
let p = project()

0 commit comments

Comments
 (0)