2018-12-06 19:17:36 +00:00
|
|
|
use crate::support::project;
|
|
|
|
use crate::support::registry::Package;
|
2018-03-20 21:33:10 +00:00
|
|
|
|
2018-03-23 19:06:49 +00:00
|
|
|
// Ensure that the "-Z minimal-versions" CLI option works and the minimal
|
|
|
|
// version of a dependency ends up in the lock file.
|
2019-06-05 18:52:53 +00:00
|
|
|
#[cargo_test]
|
2018-03-23 19:06:49 +00:00
|
|
|
fn minimal_version_cli() {
|
|
|
|
Package::new("dep", "1.0.0").publish();
|
|
|
|
Package::new("dep", "1.1.0").publish();
|
|
|
|
|
2018-07-20 11:47:47 +00:00
|
|
|
let p = project()
|
2018-03-23 19:06:49 +00:00
|
|
|
.file(
|
|
|
|
"Cargo.toml",
|
|
|
|
r#"
|
|
|
|
[package]
|
|
|
|
name = "foo"
|
|
|
|
authors = []
|
|
|
|
version = "0.0.1"
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
dep = "1.0"
|
|
|
|
"#,
|
2018-10-06 22:07:36 +00:00
|
|
|
)
|
|
|
|
.file("src/main.rs", "fn main() {}")
|
2018-03-23 19:06:49 +00:00
|
|
|
.build();
|
|
|
|
|
2018-08-28 09:20:03 +00:00
|
|
|
p.cargo("generate-lockfile -Zminimal-versions")
|
|
|
|
.masquerade_as_nightly_cargo()
|
|
|
|
.run();
|
2018-03-23 19:06:49 +00:00
|
|
|
|
|
|
|
let lock = p.read_lockfile();
|
|
|
|
|
|
|
|
assert!(lock.contains("dep 1.0.0"));
|
|
|
|
}
|