Skip to content

Commit

Permalink
test: add the no lock file case
Browse files Browse the repository at this point in the history
Signed-off-by: Rustin170506 <[email protected]>
  • Loading branch information
Rustin170506 committed Dec 19, 2024
1 parent 3a29294 commit 7482de8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testsuite/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,23 @@ path+[ROOTURL]/foo#[email protected]
.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()
Expand Down

0 comments on commit 7482de8

Please sign in to comment.