use super::*;
use crate::constants::TICK_DURATION_US;
#[test]
fn ms_to_ticks_basic() {
assert_eq!(ms_to_ticks(5.0), 50);
assert_eq!(ms_to_ticks(1.0), 10);
assert_eq!(ms_to_ticks(0.1), 1);
}
#[test]
fn us_to_ticks_basic() {
assert_eq!(us_to_ticks(500), 5);
assert_eq!(us_to_ticks(TICK_DURATION_US), 1);
assert_eq!(us_to_ticks(0), 0);
}
#[test]
fn ticks_to_ms_roundtrip() {
let ms = 7.5f32;
let ticks = ms_to_ticks(ms);
let back = ticks_to_ms(ticks);
assert!(
(back - ms).abs() < 0.01,
"roundtrip: {ms} ms {ticks} ticks {back} ms"
);
}
#[test]
fn biological_refractory_example() {
assert_eq!(ms_to_ticks(5.0), 50);
}