use keyhog_scanner::testing::decode_caesar::{is_program_source_code_path, is_source_code_path};
#[test]
fn source_path_classification_is_case_insensitive_and_separator_agnostic() {
assert!(is_program_source_code_path(Some("SRC/MAIN.RS")));
assert!(is_program_source_code_path(Some("App/Service.Py")));
assert!(is_program_source_code_path(Some("lib/Widget.TSX")));
assert!(is_program_source_code_path(Some(r"DRIVERS\FOO\MAKEFILE")));
assert!(is_program_source_code_path(Some("build/CMakeLists.txt")));
assert!(is_program_source_code_path(Some(r"linux\net\Kconfig")));
for doc in ["README.md", "notes/CHANGES.rst", "a/b/manual.TXT", "x.adoc"] {
assert!(
is_source_code_path(Some(doc)),
"{doc} should be Caesar decode-noise (is_source_code_path)"
);
assert!(
!is_program_source_code_path(Some(doc)),
"{doc} must NOT be program source (entropy must not inherit text noise)"
);
}
for carrier in ["config/secrets.env", "deploy/values.yaml", "data/dump.json"] {
assert!(
!is_program_source_code_path(Some(carrier)),
"{carrier} must not be program source"
);
assert!(
!is_source_code_path(Some(carrier)),
"{carrier} must not be Caesar decode-noise"
);
}
assert!(!is_program_source_code_path(None));
assert!(!is_source_code_path(None));
}