Skip to content

Commit c919fe3

Browse files
committed
test(embedded): Verify existing lockfile behavior
1 parent e518f7c commit c919fe3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/testsuite/script.rs

+30
Original file line numberDiff line numberDiff line change
@@ -591,3 +591,33 @@ args: []
591591
)
592592
.run();
593593
}
594+
595+
#[cargo_test]
596+
fn no_local_lockfile() {
597+
let script = ECHO_SCRIPT;
598+
let p = cargo_test_support::project()
599+
.file("script.rs", script)
600+
.build();
601+
let local_lockfile_path = p.root().join("Cargo.lock");
602+
603+
assert!(!local_lockfile_path.exists());
604+
605+
p.cargo("-Zscript script.rs")
606+
.masquerade_as_nightly_cargo(&["script"])
607+
.with_stdout(
608+
r#"bin: [ROOT]/home/.cargo/target/[..]/debug/script[EXE]
609+
args: []
610+
"#,
611+
)
612+
.with_stderr(
613+
"\
614+
[WARNING] `package.edition` is unspecifiead, defaulting to `2021`
615+
[COMPILING] script v0.0.0 ([ROOT]/foo)
616+
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
617+
[RUNNING] `[ROOT]/home/.cargo/target/[..]/debug/script[EXE]`
618+
",
619+
)
620+
.run();
621+
622+
assert!(local_lockfile_path.exists());
623+
}

0 commit comments

Comments
 (0)