Skip to content

Commit 73e3975

Browse files
committed
test: add the no lock file case
Signed-off-by: Rustin170506 <techregister@pm.me>
1 parent 9c0af53 commit 73e3975

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/testsuite/script.rs

+17
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,23 @@ path+[ROOTURL]/foo#script@0.0.0
13211321
.run();
13221322
}
13231323

1324+
#[cargo_test]
1325+
fn cmd_pkgid_with_embedded_no_lock_file() {
1326+
let p = cargo_test_support::project()
1327+
.file("script.rs", ECHO_SCRIPT)
1328+
.build();
1329+
1330+
p.cargo("-Zscript pkgid --manifest-path script.rs")
1331+
.masquerade_as_nightly_cargo(&["script"])
1332+
.with_status(101)
1333+
.with_stderr_data(str![[r#"
1334+
[WARNING] `package.edition` is unspecified, defaulting to `2024`
1335+
[ERROR] a Cargo.lock must exist for this command
1336+
1337+
"#]])
1338+
.run();
1339+
}
1340+
13241341
#[cargo_test]
13251342
fn cmd_package_with_embedded() {
13261343
let p = cargo_test_support::project()

0 commit comments

Comments
 (0)