crates/mimir-driver/tests/pin.rs
//! The driver is built against ONE nightly; assert the pin is what we think.
use mimir_driver::{MIMIR_NIGHTLY, MIMIR_NIGHTLY_COMMIT};
#[test]
fn toolchain_file_matches_the_const() {
let t = std::fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/rust-toolchain.toml")).unwrap();
assert!(t.contains(&format!("channel = \"{MIMIR_NIGHTLY}\"")), "rust-toolchain.toml channel != {MIMIR_NIGHTLY}");
}
#[test]
fn pinned_rustc_has_the_recorded_commit_hash() {
let o = std::process::Command::new("rustc")
.env("RUSTUP_TOOLCHAIN", MIMIR_NIGHTLY)
.arg("-vV")
.output()
.expect("rustc -vV");
let out = String::from_utf8_lossy(&o.stdout);
assert!(
out.lines().any(|l| l == format!("commit-hash: {MIMIR_NIGHTLY_COMMIT}")),
"pinned rustc reports:\n{out}"
);
}