test: 100% coverage for balance_of_power + median_price + true_range + typical_price + weighted_close (#32)

* test(balance_of_power): cover name metadata

Codecov flagged 3 lines (file at 96.25%): Indicator-impl name body (73-75).

* test(median_price): cover name metadata

Codecov flagged 3 lines (file at 94.44%): Indicator-impl name body (62-64).

* test(true_range): cover name metadata

Codecov flagged 3 lines (file at 95.94%): Indicator-impl name body (73-75).

* test(typical_price): cover name metadata

Codecov flagged 3 lines (file at 94.44%): Indicator-impl name body (62-64).

* test(weighted_close): cover name metadata

Codecov flagged 3 lines (file at 94.44%): Indicator-impl name body (61-63).
This commit is contained in:
kingchenc
2026-05-24 00:48:37 +02:00
committed by GitHub
parent adc8488939
commit 250b75d468
5 changed files with 35 additions and 0 deletions
@@ -132,6 +132,13 @@ mod tests {
);
}
/// Cover the Indicator-impl `name` body (73-75).
#[test]
fn name_metadata() {
let bop = BalanceOfPower::new();
assert_eq!(bop.name(), "BalanceOfPower");
}
#[test]
fn emits_from_first_candle() {
let mut bop = BalanceOfPower::new();
@@ -85,6 +85,13 @@ mod tests {
);
}
/// Cover the Indicator-impl `name` body (62-64).
#[test]
fn name_metadata() {
let mp = MedianPrice::new();
assert_eq!(mp.name(), "MedianPrice");
}
#[test]
fn emits_from_first_candle() {
let mut mp = MedianPrice::new();
@@ -95,6 +95,13 @@ mod tests {
assert_relative_eq!(out[1].unwrap(), 2.0, epsilon = 1e-12);
}
/// Cover the Indicator-impl `name` body (73-75).
#[test]
fn name_metadata() {
let tr = TrueRange::new();
assert_eq!(tr.name(), "TrueRange");
}
#[test]
fn emits_from_first_candle() {
let mut tr = TrueRange::new();
@@ -85,6 +85,13 @@ mod tests {
);
}
/// Cover the Indicator-impl `name` body (62-64).
#[test]
fn name_metadata() {
let tp = TypicalPrice::new();
assert_eq!(tp.name(), "TypicalPrice");
}
#[test]
fn emits_from_first_candle() {
let mut tp = TypicalPrice::new();
@@ -84,6 +84,13 @@ mod tests {
);
}
/// Cover the Indicator-impl `name` body (61-63).
#[test]
fn name_metadata() {
let wc = WeightedClose::new();
assert_eq!(wc.name(), "WeightedClose");
}
#[test]
fn emits_from_first_candle() {
let mut wc = WeightedClose::new();