@@ -10,6 +10,50 @@ use cargo_test_support::{
10
10
basic_bin_manifest, cargo_test, project, symlink_supported, ProjectBuilder ,
11
11
} ;
12
12
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
+
13
57
#[ cargo_test]
14
58
fn basic_lockfile_created ( ) {
15
59
let lockfile_path = "mylockfile/is/burried/Cargo.lock" ;
0 commit comments