Skip to content

Commit

Permalink
test(embedded): Verify existing lockfile behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 17, 2023
1 parent e518f7c commit c919fe3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/testsuite/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,33 @@ args: []
)
.run();
}

#[cargo_test]
fn no_local_lockfile() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
.file("script.rs", script)
.build();
let local_lockfile_path = p.root().join("Cargo.lock");

assert!(!local_lockfile_path.exists());

p.cargo("-Zscript script.rs")
.masquerade_as_nightly_cargo(&["script"])
.with_stdout(
r#"bin: [ROOT]/home/.cargo/target/[..]/debug/script[EXE]
args: []
"#,
)
.with_stderr(
"\
[WARNING] `package.edition` is unspecifiead, defaulting to `2021`
[COMPILING] script v0.0.0 ([ROOT]/foo)
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
[RUNNING] `[ROOT]/home/.cargo/target/[..]/debug/script[EXE]`
",
)
.run();

assert!(local_lockfile_path.exists());
}

0 comments on commit c919fe3

Please sign in to comment.