mirror of
https://github.com/rust-lang/cargo
synced 2024-08-28 03:39:31 +00:00
test(msrv): Show current parse behavior with X
This commit is contained in:
parent
852a31615d
commit
af9288f1b6
|
@ -124,6 +124,108 @@ fn rust_version_bad_pre_release() {
|
|||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
#[should_panic]
|
||||
fn rust_version_x_wildcard() {
|
||||
project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
edition = "2015"
|
||||
authors = []
|
||||
rust-version = "x"
|
||||
[[bin]]
|
||||
name = "foo"
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build()
|
||||
.cargo("check")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[ERROR] unexpected version requirement, expected a version like \"1.32\"
|
||||
--> Cargo.toml:7:28
|
||||
|
|
||||
7 | rust-version = \"^1.43\"
|
||||
| ^^^^^^^
|
||||
|
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
#[should_panic]
|
||||
fn rust_version_minor_x_wildcard() {
|
||||
project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
edition = "2015"
|
||||
authors = []
|
||||
rust-version = "1.x"
|
||||
[[bin]]
|
||||
name = "foo"
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build()
|
||||
.cargo("check")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[ERROR] unexpected version requirement, expected a version like \"1.32\"
|
||||
--> Cargo.toml:7:28
|
||||
|
|
||||
7 | rust-version = \"1.x\"
|
||||
| ^^^^^
|
||||
|
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
#[should_panic]
|
||||
fn rust_version_patch_x_wildcard() {
|
||||
project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
edition = "2015"
|
||||
authors = []
|
||||
rust-version = "1.30.x"
|
||||
[[bin]]
|
||||
name = "foo"
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build()
|
||||
.cargo("check")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[ERROR] unexpected version requirement, expected a version like \"1.32\"
|
||||
--> Cargo.toml:7:28
|
||||
|
|
||||
7 | rust-version = \"1.30.x\"
|
||||
| ^^^^^^^^
|
||||
|
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn rust_version_bad_nonsense() {
|
||||
project()
|
||||
|
|
Loading…
Reference in a new issue