Skip to content

Commit a1d9528

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

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

tests/testsuite/lockfile_path.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,51 @@ use cargo_test_support::{
1010
basic_bin_manifest, cargo_test, project, symlink_supported, ProjectBuilder,
1111
};
1212

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

0 commit comments

Comments
 (0)