keyhog 0.5.40

keyhog: detects leaked credentials in source trees, git history, and cloud storage
Documentation
//! Micro gate for `cli/path_validation.rs`.

use keyhog::path_validation::validate_cli_path_arg;
use std::path::Path;

#[test]
fn validate_cli_path_arg_rejects_missing_path() {
    let missing = Path::new("/tmp/keyhog-path-validation-missing-xyzzy");
    let err = validate_cli_path_arg(missing, "scan path").unwrap_err();
    assert!(
        err.to_string().contains("does not exist"),
        "missing path must error clearly; got {err}"
    );
}

#[test]
fn validate_cli_path_arg_accepts_existing_file() {
    let dir = tempfile::tempdir().unwrap();
    let file = dir.path().join("exists.txt");
    std::fs::write(&file, "ok").unwrap();
    validate_cli_path_arg(&file, "scan path").unwrap();
}