import std/unittest import std/math import geometry import ../tools/scenegen suite "scenegen (bench scenes)": test "exactly n walls, deterministic per seed, seeds differ": let a = genScene(16384, 5000, 1) check a.len == 5000 check a == genScene(16384, 5000, 1) check a != genScene(16384, 5000, 2) test "doors are every 10th wall, all closed; walls stay inside the world (+- jitter)": let a = genScene(4096, 5000, 1) var doors = 0 for i, w in a: check w.door == (i mod 10 == 9) check not w.open for p in [w.a, w.b]: check p.x >= -6 and p.x <= 4096 + 6 and p.y >= -6 and p.y <= 4096 + 6 if w.door: inc doors check doors == 500 test "walls are non-degenerate and axis-ish segments of room-edge length": for w in genScene(16384, 5000, 1): check hypot(w.b.x - w.a.x, w.b.y - w.a.y) > 100