crates/gunnar-ui-server/tests/monetize_protos_are_the_crates.rs
//! ★ RA3-4: **this console speaks monetize's wire through monetize-proto, not a hand copy.**
//!
//! Until 2026-10-26 gunnar-ui-server compiled its own copies of five monetize protos
//! (`proto/monetize/v1/{common,products,purchase,signup,estate_order}.proto`), held to
//! monetize's by a byte-for-byte drift guard that went red on every comment monetize changed
//! (A32-12, 3a8b73e3). monetize-proto 0.3.0 is on crates.io: `crate::mpb` is that crate, and
//! the copies are gone. These read the tree only.
use std::path::Path;
fn root() -> &'static Path {
Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/../.."))
}
#[test]
fn no_monetize_proto_is_copied_here() {
assert!(!root().join("proto/monetize").exists(), "proto/monetize/: monetize's wire is monetize-proto's");
let build = std::fs::read_to_string(root().join("crates/gunnar-ui-server/build.rs")).unwrap();
assert!(!build.contains("MONETIZE_PROTO_FILES"), "build.rs compiles no monetize proto");
let lib = std::fs::read_to_string(root().join("crates/gunnar-ui-server/src/lib.rs")).unwrap();
assert!(lib.contains("pub use monetize_proto::*;"), "crate::mpb is monetize-proto");
let manifest = std::fs::read_to_string(root().join("crates/gunnar-ui-server/Cargo.toml")).unwrap();
assert!(manifest.contains("monetize-proto = { version = \"0.3.0\""), "the crate, at the published line");
}