Skip to content

Commit e4e6261

Browse files
committed
Added another test.
1 parent 71ee2c9 commit e4e6261

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/testsuite/build_script.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5501,6 +5501,7 @@ fn test_new_syntax_with_old_msrv() {
55015501
[COMPILING] foo [..]
55025502
error: the `cargo::` syntax for build script output instructions was added in Rust 1.77.0, \
55035503
but the minimum supported Rust version of `foo v0.5.0 ([ROOT]/foo)` is 1.60.0.
5504+
Consider using the old `cargo:foo=bar` syntax instead of `cargo::metadata=foo=bar` (note the single colon).
55045505
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script \
55055506
for more information about build script outputs.
55065507
",
@@ -5549,6 +5550,46 @@ for more information about build script outputs.
55495550
.run();
55505551
}
55515552

5553+
#[cargo_test]
5554+
fn test_new_syntax_with_old_msrv_and_unknown_prefix() {
5555+
let p = project()
5556+
.file(
5557+
"Cargo.toml",
5558+
r#"
5559+
[package]
5560+
name = "foo"
5561+
version = "0.5.0"
5562+
edition = "2015"
5563+
authors = []
5564+
build = "build.rs"
5565+
rust-version = "1.60.0"
5566+
"#,
5567+
)
5568+
.file("src/lib.rs", "")
5569+
.file(
5570+
"build.rs",
5571+
r#"
5572+
fn main() {
5573+
println!("cargo::foo=bar");
5574+
}
5575+
"#,
5576+
)
5577+
.build();
5578+
5579+
p.cargo("build")
5580+
.with_status(101)
5581+
.with_stderr_contains(
5582+
"\
5583+
[COMPILING] foo [..]
5584+
error: the `cargo::` syntax for build script output instructions was added in Rust 1.77.0, \
5585+
but the minimum supported Rust version of `foo v0.5.0 ([ROOT]/foo)` is 1.60.0.
5586+
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script \
5587+
for more information about build script outputs.
5588+
",
5589+
)
5590+
.run();
5591+
}
5592+
55525593
#[cargo_test]
55535594
fn test_new_syntax_with_compatible_partial_msrv() {
55545595
let p = project()

0 commit comments

Comments
 (0)