fabrilis/crates/core/src/id/tests.rs
loki5512344 878d144b77 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

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)");
}