File tree 2 files changed +39
-0
lines changed 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ //! Tests for minimal-version resolution.
2
+ //!
3
+ //! Note: Some tests are located in the resolver-tests package.
4
+
5
+ use cargo_test_support:: project;
6
+ use cargo_test_support:: registry:: Package ;
7
+
8
+ // Ensure that the "-Z minimal-versions" CLI option works and the minimal
9
+ // version of a dependency ends up in the lock file.
10
+ #[ cargo_test]
11
+ fn minimal_version_cli ( ) {
12
+ Package :: new ( "dep" , "1.0.0" ) . publish ( ) ;
13
+ Package :: new ( "dep" , "1.1.0" ) . publish ( ) ;
14
+
15
+ let p = project ( )
16
+ . file (
17
+ "Cargo.toml" ,
18
+ r#"
19
+ [package]
20
+ name = "foo"
21
+ authors = []
22
+ version = "0.0.1"
23
+
24
+ [dependencies]
25
+ dep = "1.0"
26
+ "# ,
27
+ )
28
+ . file ( "src/main.rs" , "fn main() {}" )
29
+ . build ( ) ;
30
+
31
+ p. cargo ( "generate-lockfile -Zminimal-versions" )
32
+ . masquerade_as_nightly_cargo ( & [ "minimal-versions" ] )
33
+ . run ( ) ;
34
+
35
+ let lock = p. read_lockfile ( ) ;
36
+
37
+ assert ! ( !lock. contains( "1.1.0" ) ) ;
38
+ }
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ mod cross_publish;
43
43
mod custom_target;
44
44
mod death;
45
45
mod dep_info;
46
+ mod direct_minimal_versions;
46
47
mod directory;
47
48
mod doc;
48
49
mod docscrape;
You can’t perform that action at this time.
0 commit comments