test: 100% coverage for keltner + linreg + linreg_slope + macd + super_trend (#30)

* test(keltner): cover periods accessor + name metadata

Codecov flagged 6 lines (file at 95.23%): periods (68-70) + name (106-108).

* test(linreg): cover period accessor + name metadata

Codecov flagged 6 lines (file at 96.10%): period (92-94) + name (142-144).

* test(linreg_slope): cover period accessor + name metadata

Codecov flagged 6 lines (file at 95.91%): period (80-82) + name (125-127).

* test(macd): cover periods/value accessors + name metadata

Codecov flagged 6 lines (file at 95.45%): periods (81-83) + name (135-137).

* test(super_trend): cover params accessor + name metadata

Codecov flagged 6 lines (file at 96.36%): params (99-101) + name (176-178).
This commit is contained in:
kingchenc
2026-05-24 00:47:59 +02:00
committed by GitHub
parent 8f6ffe5a62
commit 512bbf75c4
5 changed files with 57 additions and 0 deletions
@@ -199,6 +199,15 @@ mod tests {
assert!(LinearRegression::new(2).is_ok());
}
/// Cover the const accessor `period` (92-94) and the Indicator-impl
/// `name` body (142-144). `warmup_period` is exercised elsewhere.
#[test]
fn accessors_and_metadata() {
let lr = LinearRegression::new(14).unwrap();
assert_eq!(lr.period(), 14);
assert_eq!(lr.name(), "LinearRegression");
}
#[test]
fn reset_clears_state() {
let mut lr = LinearRegression::new(5).unwrap();