From e713e05931ac909f2e3ddb075dde974118a8d072 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Sun, 15 Nov 2026 12:55:58 +0100 Subject: [PATCH] tools: define the scene.set mutation after the dispatcher (#25) --- tools/mutation.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mutation.sh b/tools/mutation.sh index c2faece..5a23707 100755 --- a/tools/mutation.sh +++ b/tools/mutation.sh @@ -26,8 +26,6 @@ # c1: a tile is allowed without any explored cell | c2: every overlapping cell is required # c3: an out-of-grid coordinate is accepted | c4: a leading-zero coordinate is canonical # d3: scene.set accepts a patch with no field (slice 10, #25) -# slice 10 (#25): scene.set accepts a patch with no field at all -run d3 "scene.set accepts a patch with no field" server/world.nim 's/^ if not any: return none(ScenePatch)$/ discard/' "a patch with none is invalid" # Parallel: MUTATION_JOBS (default nproc/4) jobs, each in its own temp copy + nimcache; output collected, printed in fixed order. # Tests run with FFF_MUTATION=1 (iteration counts ~/10, see tests/testutil.nim scaled()); only test files holding an expected # test are run per mutation (control runs all). Debug build. Wrapped in systemd-inhibit (sleep:idle) when that works. @@ -183,6 +181,8 @@ run c1 "the tile gate ignores the explored set" server/tiles.nim 's/ if sc\ run c2 "the tile gate needs every overlapping cell" server/tiles.nim 's/ if sc\.cellIndex(cx, cy) in explored: return true/ if sc.cellIndex(cx, cy) notin explored: return false/' "$TILE_GATE" run c3 "an out-of-grid tile coordinate is accepted" server/tiles.nim 's/^ x >= 0 and y >= 0 and x < tileCols(sc) and y < tileRows(sc)$/ x >= 0 and y >= 0/' "$TILE_RANGE" run c4 "a leading-zero tile coordinate is canonical" server/tiles.nim "s/ if raw\[0\] == '0' and raw.len > 1: return false/ discard/" "$TILE_ZERO" +# slice 10 (#25): scene.set needs at least one patch field (server/world.nim parseScenePatch) +run d3 "scene.set accepts a patch with no field" server/world.nim 's/^ if not any: return none(ScenePatch)$/ discard/' "a patch with none is invalid" wait rc=0; : > "$LOG"