test(script): Show autolib bug from #14476

This commit is contained in:
Ed Page 2024-09-24 10:22:44 -05:00
parent c730621d38
commit fa8fd7f48a

View File

@ -813,6 +813,31 @@ Hello world!
.run();
}
#[cargo_test]
fn test_no_autolib() {
let script = r#"#!/usr/bin/env cargo
fn main() {
println!("Hello world!");
}"#;
let p = cargo_test_support::project()
.file("script.rs", script)
.file("src/lib.rs", r#"compile_error!{"must not be built"}"#)
.build();
p.cargo("-Zscript -v script.rs --help")
.masquerade_as_nightly_cargo(&["script"])
.with_status(101)
.with_stdout_data(str![""])
.with_stderr_data(str![[r#"
...
[..]compile_error!{"must not be built"}[..]
...
"#]])
.run();
}
#[cargo_test]
fn implicit_target_dir() {
let script = ECHO_SCRIPT;