Skip to content

Commit

Permalink
test: lockfile path unstable feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifropc committed Aug 17, 2024
1 parent 4baaaec commit aa7ead5
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/testsuite/lockfile_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,50 @@ use cargo_test_support::{
basic_bin_manifest, cargo_test, project, symlink_supported, ProjectBuilder,
};

///////////////////////////////
//// Unstable feature tests start
///////////////////////////////

#[cargo_test]
fn must_have_unstable_options() {
let lockfile_path = "mylockfile/is/burried/Cargo.lock";
let p = make_project().build();

p.cargo("generate-lockfile")
.masquerade_as_nightly_cargo(&["lockfile-path"])
.arg("--lockfile-path")
.arg(lockfile_path)
.with_stderr_data(str![[
r#"[ERROR] the `--lockfile-path` flag is unstable, pass `-Z unstable-options` to enable it
See https://github.com/rust-lang/cargo/issues/5707 for more information about the `--lockfile-path` flag.
"#]])
.with_status(101)
.run();
}

#[cargo_test]
fn must_be_nightly() {
let lockfile_path = "mylockfile/is/burried/Cargo.lock";
let p = make_project().build();

p.cargo("generate-lockfile")
.arg("-Zunstable-options")
.arg("--lockfile-path")
.arg(lockfile_path)
.with_stderr_data(str![[
r#"[ERROR] the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
"#]])
.with_status(101)
.run();
}

///////////////////////////////
//// Unstable feature tests end
///////////////////////////////

#[cargo_test]
fn basic_lockfile_created() {
let lockfile_path = "mylockfile/is/burried/Cargo.lock";
Expand Down

0 comments on commit aa7ead5

Please sign in to comment.