#[cfg_attr(coverage_nightly, coverage(off))]
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_severity_ordering() {
assert!(Severity::High > Severity::Medium);
assert!(Severity::Medium > Severity::Low);
}
#[test]
fn test_repetition_severity() {
let config = EntropyConfig::default();
let detector = ViolationDetector::new(config);
assert_eq!(detector.calculate_repetition_severity(3), Severity::Low);
assert_eq!(detector.calculate_repetition_severity(7), Severity::Medium);
assert_eq!(detector.calculate_repetition_severity(15), Severity::High);
}
}
#[cfg_attr(coverage_nightly, coverage(off))]
#[cfg(test)]
mod property_tests {
use proptest::prelude::*;
proptest! {
#[test]
fn basic_property_stability(_input in ".*") {
prop_assert!(true);
}
#[test]
fn module_consistency_check(_x in 0u32..1000) {
prop_assert!(_x < 1001);
}
}
}
include!("violation_detector_coverage_tests.rs");
include!("violation_detector_detection_tests.rs");