mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
test(script): Show autolib bug from #14476
This commit is contained in:
parent
c730621d38
commit
fa8fd7f48a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user