Skip to content

Commit

Permalink
types/range_index: add test for filter_range
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlettman committed Aug 13, 2024
1 parent 57eda22 commit dcf933a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/types/range_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,28 @@ mod tests {
}
}

#[test]
fn test_filter_delay() {
let cases = vec![
(RangeIndex::X12_5cm, 0.016),
(RangeIndex::X25cm, 0.016),
(RangeIndex::X50cm, 0.016),
(RangeIndex::X75cm, 0.016),
(RangeIndex::X1m, 0.020),
(RangeIndex::X2m, 0.024),
(RangeIndex::X3m, 0.030),
(RangeIndex::X4m, 0.030),
(RangeIndex::X5m, 0.030),
(RangeIndex::X6m, 0.030),
];

for (range, want) in cases {
info!("Getting filter delay for {range:?}, want {want:?}");
let got = range.filter_delay();
assert_eq!(want, got);
}
}

#[test]
fn test_display() {
let cases = vec![
Expand Down

0 comments on commit dcf933a

Please sign in to comment.