diff --git a/tests/testsuite/script.rs b/tests/testsuite/script.rs index c2507cdb15e5..79ab85303730 100644 --- a/tests/testsuite/script.rs +++ b/tests/testsuite/script.rs @@ -1321,6 +1321,23 @@ path+[ROOTURL]/foo#script@0.0.0 .run(); } +#[cargo_test] +fn cmd_pkgid_with_embedded_no_lock_file() { + let p = cargo_test_support::project() + .file("script.rs", ECHO_SCRIPT) + .build(); + + p.cargo("-Zscript pkgid --manifest-path script.rs") + .masquerade_as_nightly_cargo(&["script"]) + .with_status(101) + .with_stderr_data(str![[r#" +[WARNING] `package.edition` is unspecified, defaulting to `2024` +[ERROR] a Cargo.lock must exist for this command + +"#]]) + .run(); +} + #[cargo_test] fn cmd_package_with_embedded() { let p = cargo_test_support::project()