keyhog 0.5.50

GPU-accelerated secret scanner for code, Git history, cloud, containers, browser assets, and live credential verification
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! 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")
    })
}