File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 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 @@ -42,6 +42,7 @@ mod cross_publish;
42
42
mod custom_target;
43
43
mod death;
44
44
mod dep_info;
45
+ mod direct_minimal_versions;
45
46
mod directory;
46
47
mod doc;
47
48
mod docscrape;
You can’t perform that action at this time.
0 commit comments