test: pin decide's chrF tolerance to billionths on two-decimal pairs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Weksa 2026-11-10 07:49:15 +00:00
commit 592dbd7e67

View file

@ -1474,6 +1474,17 @@ mod tests {
let drop = reading(50.0, meaning - LADDER_STEP, 0.5);
assert_eq!(decide(&base, &drop, &zero), Verdict::Rejected(Why::NoGain));
}
// Two-decimal chrF readings are not binary-exact: in float, 84 of these
// pairs would read as a regression of more than 0.5.
for i in 60..10_000 {
let base = reading(f64::from(i) / 100.0, 0.5, 0.5);
let drop = reading(f64::from(i - 50) / 100.0, 0.5, 0.5);
assert_eq!(
decide(&base, &drop, &zero),
Verdict::Rejected(Why::NoGain),
"{i}"
);
}
}
fn replicate(n: u32, digest: &str, chrf: f64, meaning: f64) -> RoundRecord {