docs: fix ETD safe-pace test to a genuinely safe case

This commit is contained in:
Carlos Miguel C. Resurreccion 2026-06-19 16:42:11 +08:00
parent e2d5298466
commit e275646007

View File

@ -41,9 +41,10 @@ mod tests {
#[test]
fn etd_none_when_on_safe_pace() {
// 50% used, 1h elapsed of a 5h window (4h remaining).
// Project ~1h more to full → total ~2h « 4h remaining → safe.
assert_eq!(etd_secs(50.0, 4 * 3600, 5 * 3600), None);
// 10% used, 1h elapsed of a 5h window (4h remaining): steady pace at 1h
// is 20%, so 10% is UNDER pace → would not deplete before reset.
// (50% in the first hour would be at-risk, not safe — see the invariant.)
assert_eq!(etd_secs(10.0, 4 * 3600, 5 * 3600), None);
}
#[test]