Skip to content

Commit

Permalink
test(script): Show autolib bug from rust-lang#14476
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 24, 2024
1 parent 3605ed0 commit ebd326f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/testsuite/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ebd326f

Please sign in to comment.