Skip to content

Commit 0d08e19

Browse files
Xaeroxeweihanglo
authored andcommitted
test(freshness_checksum): verify unstable flag is gated correctly
1 parent 66998ea commit 0d08e19

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

tests/testsuite/freshness_checksum.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ use cargo_test_support::{
1414

1515
use super::death;
1616

17+
#[cargo_test]
18+
fn non_nightly_fails() {
19+
let p = project().file("src/main.rs", "fn main() {}").build();
20+
p.cargo("build -Zchecksum-freshness")
21+
.with_stderr_data(str![[r#"
22+
[ERROR] the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
23+
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
24+
25+
"#]])
26+
.with_status(101)
27+
.run();
28+
}
29+
1730
#[cargo_test(nightly, reason = "requires -Zchecksum-hash-algorithm")]
1831
fn checksum_actually_uses_checksum() {
1932
let p = project()
@@ -1584,7 +1597,8 @@ fn bust_patched_dep() {
15841597
[RUNNING] `rustc --crate-name foo [..]
15851598
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
15861599
1587-
"#]]).run();
1600+
"#]])
1601+
.run();
15881602

15891603
p.cargo("build -Zchecksum-freshness -v")
15901604
.masquerade_as_nightly_cargo(&["checksum-freshness"])
@@ -1703,7 +1717,8 @@ fn rebuild_on_mid_build_file_modification() {
17031717
[RUNNING] `rustc --crate-name root [..]
17041718
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
17051719
1706-
"#]]).run();
1720+
"#]])
1721+
.run();
17071722

17081723
t.join().ok().unwrap();
17091724
}

0 commit comments

Comments
 (0)