#[cfg(test)] mod tests { use crate::common::is_binary::is_binary; #[test] fn test_is_binary_text() { let text_data = b"Hello, World! This is plain text.\nWith newlines and spaces."; let result = is_binary(text_data); // Text data should not be detected as binary assert!(!result); } #[test] fn test_is_binary_binary() { let binary_data = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09"; let result = is_binary(binary_data); // Binary data should be detected as binary assert!(result); } #[test] fn test_is_binary_png_signature() { let png_data = b"\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"; let result = is_binary(png_data); // PNG signature should be detected as binary assert!(result); } #[test] fn test_is_binary_empty() { let empty_data = b""; let result = is_binary(empty_data); // Empty data should not be detected as binary assert!(!result); } }