use super::ProbeStats;
#[test]
fn decay_halves_each_window() {
let stats = ProbeStats::default();
for _ in 0..8 {
stats.probe();
}
for _ in 0..6 {
stats.negative();
}
stats.decay();
assert_eq!((stats.probes(), stats.negatives()), (4, 3));
stats.decay();
assert_eq!((stats.probes(), stats.negatives()), (2, 1));
for _ in 0..4 {
stats.decay();
}
assert_eq!((stats.probes(), stats.negatives()), (0, 0));
}