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.
17 lines
290 B
Rust
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)
|
|
}
|
|
);
|
|
}
|