fabrilis/crates/core/src/snapshot/tests.rs
loki5512344 79928b645b
Initial commit: Fabrilis docs, rules and deterministic core
Docs (architecture, decisions, coupling, determinism, UI, references), code rules enforced by tools/limits, deterministic core with units, time, math, sched, snapshot, vec and rng, plus smoke tests. ref/ stays out of git.
2026-11-16 23:06:29 +01:00

17 lines
290 B
Rust

use super::*;
#[test]
fn publish_swaps_and_counts() {
let mut buf = DoubleBuffer::new(0_u32);
*buf.back_mut() = 7;
assert_eq!(*buf.front(), 0);
buf.publish(SimTime(100));
assert_eq!(*buf.front(), 7);
assert_eq!(
buf.header(),
Header {
tick: 1,
time: SimTime(100)
}
);
}