Skip to content

Commit fa8fd7f

Browse files
committed
test(script): Show autolib bug from #14476
1 parent c730621 commit fa8fd7f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/testsuite/script.rs

+25
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,31 @@ Hello world!
813813
.run();
814814
}
815815

816+
#[cargo_test]
817+
fn test_no_autolib() {
818+
let script = r#"#!/usr/bin/env cargo
819+
820+
fn main() {
821+
println!("Hello world!");
822+
}"#;
823+
let p = cargo_test_support::project()
824+
.file("script.rs", script)
825+
.file("src/lib.rs", r#"compile_error!{"must not be built"}"#)
826+
.build();
827+
828+
p.cargo("-Zscript -v script.rs --help")
829+
.masquerade_as_nightly_cargo(&["script"])
830+
.with_status(101)
831+
.with_stdout_data(str![""])
832+
.with_stderr_data(str![[r#"
833+
...
834+
[..]compile_error!{"must not be built"}[..]
835+
...
836+
837+
"#]])
838+
.run();
839+
}
840+
816841
#[cargo_test]
817842
fn implicit_target_dir() {
818843
let script = ECHO_SCRIPT;

0 commit comments

Comments
 (0)