//! Gate `daemon::protocol`: test functions stay in external split modules.
#[test]
fn daemon_protocol_no_inline_tests() {
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/src/daemon/protocol.rs");
let src = std::fs::read_to_string(path).expect("source readable");
assert!(
!has_test_function(&src),
"daemon::protocol: move test functions to the external wire test modules"
);
}
fn has_test_function(source: &str) -> bool {
source.lines().map(str::trim).any(|line| {
line == "#[test]" || line.starts_with("#[tokio::test") || line.starts_with("#[rstest")
})
}