Skip to content

Commit aa7ead5

Browse files
committed
test: lockfile path unstable feature tests
1 parent 4baaaec commit aa7ead5

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

tests/testsuite/lockfile_path.rs

+44
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,50 @@ use cargo_test_support::{
1010
basic_bin_manifest, cargo_test, project, symlink_supported, ProjectBuilder,
1111
};
1212

13+
///////////////////////////////
14+
//// Unstable feature tests start
15+
///////////////////////////////
16+
17+
#[cargo_test]
18+
fn must_have_unstable_options() {
19+
let lockfile_path = "mylockfile/is/burried/Cargo.lock";
20+
let p = make_project().build();
21+
22+
p.cargo("generate-lockfile")
23+
.masquerade_as_nightly_cargo(&["lockfile-path"])
24+
.arg("--lockfile-path")
25+
.arg(lockfile_path)
26+
.with_stderr_data(str![[
27+
r#"[ERROR] the `--lockfile-path` flag is unstable, pass `-Z unstable-options` to enable it
28+
See https://github.com/rust-lang/cargo/issues/5707 for more information about the `--lockfile-path` flag.
29+
30+
"#]])
31+
.with_status(101)
32+
.run();
33+
}
34+
35+
#[cargo_test]
36+
fn must_be_nightly() {
37+
let lockfile_path = "mylockfile/is/burried/Cargo.lock";
38+
let p = make_project().build();
39+
40+
p.cargo("generate-lockfile")
41+
.arg("-Zunstable-options")
42+
.arg("--lockfile-path")
43+
.arg(lockfile_path)
44+
.with_stderr_data(str![[
45+
r#"[ERROR] the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
46+
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
47+
48+
"#]])
49+
.with_status(101)
50+
.run();
51+
}
52+
53+
///////////////////////////////
54+
//// Unstable feature tests end
55+
///////////////////////////////
56+
1357
#[cargo_test]
1458
fn basic_lockfile_created() {
1559
let lockfile_path = "mylockfile/is/burried/Cargo.lock";

0 commit comments

Comments
 (0)