Skip to main content

actionqueue_daemon/time/
clock.rs

1//! Daemon clock re-exports from `actionqueue-core`.
2//!
3//! All clock types are now defined in `actionqueue_core::time::clock`.
4//! This module provides backward-compatible type aliases.
5
6pub use actionqueue_core::time::clock::{Clock, MockClock, SharedClock, SystemClock};
7
8/// Backward-compatible alias for [`SharedClock`].
9pub type SharedDaemonClock = SharedClock;
10
11#[cfg(test)]
12mod tests {
13    use super::{Clock, MockClock, SystemClock};
14
15    #[test]
16    fn fixed_clock_returns_deterministic_timestamp() {
17        let clock = MockClock::new(1_700_000_000);
18        assert_eq!(clock.now(), 1_700_000_000);
19    }
20
21    #[test]
22    fn system_clock_now_is_non_panicking() {
23        let clock = SystemClock;
24        let now = clock.now();
25        assert!(now > 0);
26    }
27}