Skip to content

Commit f68be76

Browse files
committed
test(msrv): Show current parse behavior with X
1 parent 852a316 commit f68be76

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/testsuite/rust_version.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,40 @@ fn rust_version_bad_pre_release() {
124124
.run();
125125
}
126126

127+
#[cargo_test]
128+
#[should_panic]
129+
fn rust_version_x_wildcard() {
130+
project()
131+
.file(
132+
"Cargo.toml",
133+
r#"
134+
[package]
135+
name = "foo"
136+
version = "0.0.1"
137+
edition = "2015"
138+
authors = []
139+
rust-version = "x"
140+
[[bin]]
141+
name = "foo"
142+
"#,
143+
)
144+
.file("src/main.rs", "fn main() {}")
145+
.build()
146+
.cargo("check")
147+
.with_status(101)
148+
.with_stderr(
149+
"\
150+
[ERROR] unexpected version requirement, expected a version like \"1.32\"
151+
--> Cargo.toml:7:28
152+
|
153+
7 | rust-version = \"^1.43\"
154+
| ^^^^^^^
155+
|
156+
",
157+
)
158+
.run();
159+
}
160+
127161
#[cargo_test]
128162
fn rust_version_bad_nonsense() {
129163
project()

0 commit comments

Comments
 (0)