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.
This commit is contained in:
commit
79928b645b
222 changed files with 5335 additions and 0 deletions
17
crates/core/src/snapshot/tests.rs
Normal file
17
crates/core/src/snapshot/tests.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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)
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue