tests: the restart and logs groups, the nine-group checklist and the fixture clean-up (#25)

This commit is contained in:
2026-11-15 12:52:20 +01:00
parent 70a984c55a
commit cedb80aa96
7 changed files with 474 additions and 13 deletions
+6 -1
View File
@@ -199,6 +199,11 @@ type Scene = object
tokens: seq[Vec]
radius, cell, tokenRadius: float
const PrototypeTokenRadius = 20.0
## The prototype scene's scene-wide token radius. It is a *fixture* value since slice 10 (#25):
## M3 has a per-token radius (5.6, #4) and no scene-wide fixture field, so the JSON no longer
## carries one (nor its stale `tileSize`, nor index token ids). Only this seed test uses it.
proc loadScene(): Scene =
# fixtures are copies of prototype-server-vision/data/scene.json; a missing file fails, never skips
let j = parseFile(currentSourcePath().parentDir / "fixtures" / "scene.json")
@@ -208,7 +213,7 @@ proc loadScene(): Scene =
for t in j["tokens"]: result.tokens.add (t["pos"][0].getFloat, t["pos"][1].getFloat)
result.radius = j["visionRadius"].getFloat
result.cell = j["exploredCell"].getFloat
result.tokenRadius = j["tokenRadius"].getFloat
result.tokenRadius = PrototypeTokenRadius
suite "seed":
test "every token in seed sees itself and is not walled in":