use std::time::Duration;
use osproxy_core::time::{Clock, ManualClock};
use osproxy_core::Epoch;
use proptest::prelude::*;
proptest! {
#[test]
fn epoch_next_is_strictly_increasing(g in 0u64..u64::MAX) {
let e = Epoch::new(g);
prop_assert!(e.next() > e);
prop_assert_eq!(e.next().get(), g + 1);
}
#[test]
fn manual_clock_accumulates_advances_exactly(steps in prop::collection::vec(0u64..1_000_000, 0..32)) {
let clock = ManualClock::new();
let start = clock.now();
let mut expected_nanos = 0u128;
for ms in steps {
clock.advance(Duration::from_micros(ms));
expected_nanos += u128::from(ms) * 1_000;
}
let elapsed = clock.now().saturating_duration_since(start);
prop_assert_eq!(elapsed.as_nanos(), expected_nanos);
}
}