Skip to content

Commit f535b67

Browse files
committed
verify that unstable flag is gated correctly
1 parent e243884 commit f535b67

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: tests/testsuite/freshness_checksum.rs

+13
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+
let mut cmd = p.cargo("build").arg("-Zchecksum-freshness").build_command();
21+
let output = cmd.output().unwrap();
22+
assert!(
23+
String::from_utf8(output.stderr)
24+
.unwrap()
25+
.contains("error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel")
26+
);
27+
assert!(!output.status.success());
28+
}
29+
1730
#[cargo_test(nightly, reason = "requires -Zchecksum-hash-algorithm")]
1831
fn checksum_actually_uses_checksum() {
1932
let p = project()

0 commit comments

Comments
 (0)