A3: close core test-coverage gaps

Adds the reset tests the audit named as missing (aroon, awesome
oscillator, donchian, keltner, williams_r, and both VWAP variants),
non-finite-input tests for every scalar indicator that guards is_finite
(WMA, RSI, MACD, Bollinger, KAMA), and naive-reference proptests for EMA,
RSI and ATR. 189 core tests pass.
This commit is contained in:
kingchenc
2026-05-22 03:34:19 +02:00
parent f3dcee1cb5
commit 5627612d44
13 changed files with 327 additions and 0 deletions
+12
View File
@@ -227,4 +227,16 @@ mod tests {
assert!(!macd.is_ready());
assert_eq!(macd.update(1.0), None);
}
#[test]
fn ignores_non_finite_input() {
let mut macd = MacdIndicator::classic();
macd.batch(&(1..=80).map(f64::from).collect::<Vec<_>>());
let before = macd.value();
assert!(before.is_some());
// Non-finite inputs return the last value without advancing any EMA.
assert_eq!(macd.update(f64::NAN), before);
assert_eq!(macd.update(f64::INFINITY), before);
assert_eq!(macd.value(), before);
}
}