#![allow(
clippy::cast_possible_truncation,
clippy::cast_sign_loss,
clippy::unreadable_literal,
clippy::panic,
clippy::manual_let_else
)]
use simdsieve::SimdSieve;
#[test]
fn test_long_pattern_fingerprinting() {
let haystack = b"xxxContent-Security-Policy: default-src 'none';xxx".to_vec();
let sieve = SimdSieve::new(
&haystack,
&[b"Content-Security-Policy: default-src 'none';"],
)
.unwrap();
let results: Vec<usize> = sieve.collect();
assert_eq!(results, vec![3]);
}
#[test]
fn test_density_scoring_algorithm() {
let haystack = b"AAAAAAAABBBBAAAACAA".repeat(10);
let score = SimdSieve::estimate_match_count(&haystack, &[b"AA", b"BBB"], false);
assert!(
score > 0,
"Threat density accumulator failed to capture mass hits"
);
}