mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00

These tests take a good amount of time to run locally and they're also causing a lot of dependencies to get pulled into rust-lang/rust, so let's have a separate crate that we just test on our own CI
35 lines
831 B
Rust
35 lines
831 B
Rust
use crate::support::project;
|
|
use crate::support::registry::Package;
|
|
|
|
// Ensure that the "-Z minimal-versions" CLI option works and the minimal
|
|
// version of a dependency ends up in the lock file.
|
|
#[cargo_test]
|
|
fn minimal_version_cli() {
|
|
Package::new("dep", "1.0.0").publish();
|
|
Package::new("dep", "1.1.0").publish();
|
|
|
|
let p = project()
|
|
.file(
|
|
"Cargo.toml",
|
|
r#"
|
|
[package]
|
|
name = "foo"
|
|
authors = []
|
|
version = "0.0.1"
|
|
|
|
[dependencies]
|
|
dep = "1.0"
|
|
"#,
|
|
)
|
|
.file("src/main.rs", "fn main() {}")
|
|
.build();
|
|
|
|
p.cargo("generate-lockfile -Zminimal-versions")
|
|
.masquerade_as_nightly_cargo()
|
|
.run();
|
|
|
|
let lock = p.read_lockfile();
|
|
|
|
assert!(lock.contains("dep 1.0.0"));
|
|
}
|