Skip to content

Commit 92ab6f5

Browse files
committed
test(embedded): Verify no autobin behavior is running
1 parent b0b83da commit 92ab6f5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/testsuite/script.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,3 +508,32 @@ fn main() {
508508
)
509509
.run();
510510
}
511+
512+
#[cargo_test]
513+
fn test_no_autobins() {
514+
let script = r#"#!/usr/bin/env cargo
515+
516+
fn main() {
517+
println!("Hello world!");
518+
}"#;
519+
let p = cargo_test_support::project()
520+
.file("script.rs", script)
521+
.file("src/bin/not-script/main.rs", "fn main() {}")
522+
.build();
523+
524+
p.cargo("-Zscript script.rs --help")
525+
.masquerade_as_nightly_cargo(&["script"])
526+
.with_stdout(
527+
r#"Hello world!
528+
"#,
529+
)
530+
.with_stderr(
531+
"\
532+
[WARNING] `package.edition` is unspecifiead, defaulting to `2021`
533+
[COMPILING] script v0.0.0 ([ROOT]/home/.cargo/eval/target/eval/[..]/script)
534+
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
535+
[RUNNING] `[ROOT]/home/.cargo/eval/target/eval/[..]/script/target/debug/script[EXE] --help`
536+
",
537+
)
538+
.run();
539+
}

0 commit comments

Comments
 (0)