pub const FROZEN_TYPES_SHA256: &str =
"0d51da823e5efcd23ef500a35c50009540c0f0c22ca20871d254bdf243c86b9c";
pub const FROZEN_COMPUTE_SHA256: &str =
"38e87b7d7954988c312d0dbdac103b52ad206aa014aad791594cb4f72ae1e62e";
pub const FROZEN_SE_SHA256: &str =
"3aba83c20bee7816d6d7ec716867bcfb5fef8f360f1cc5c4aa00559f51795889";
#[cfg(test)]
mod tests {
use super::*;
use sha2::{Digest, Sha256};
fn hash(bytes: &[u8]) -> String {
let mut h = Sha256::new();
h.update(bytes);
h.finalize().iter().map(|b| format!("{b:02x}")).collect()
}
#[test]
fn frozen_engine_files_are_unchanged() {
assert_eq!(
hash(include_bytes!("types.rs")),
FROZEN_TYPES_SHA256,
"tax/types.rs was edited — the delta engine is FROZEN (SPEC_full_return §2)"
);
assert_eq!(
hash(include_bytes!("compute.rs")),
FROZEN_COMPUTE_SHA256,
"tax/compute.rs was edited — the delta engine is FROZEN (SPEC_full_return §2)"
);
assert_eq!(
hash(include_bytes!("se.rs")),
FROZEN_SE_SHA256,
"tax/se.rs was edited — the delta engine is FROZEN (SPEC_full_return §2)"
);
}
}