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.
14 lines
305 B
Rust
14 lines
305 B
Rust
use super::*;
|
|
|
|
struct Part;
|
|
|
|
#[test]
|
|
fn ids_are_sequential_and_ordered() {
|
|
let mut generator = IdGen::<Part>::default();
|
|
let a = generator.alloc();
|
|
let b = generator.alloc();
|
|
assert_eq!((a.raw(), b.raw()), (0, 1));
|
|
assert!(a < b);
|
|
assert_eq!(b.index(), 1);
|
|
assert_eq!(format!("{a:?}"), "Id(0)");
|
|
}
|