+26
-5
@@ -13,6 +13,9 @@
|
||||
# v: the id counter is never written to the DB | w: a wall may stay open | x: zero-length walls accepted
|
||||
# y: wall endpoints unchecked against the world bounds | z: door.set on a plain wall accepted | z2: persisted `open` loaded inverted
|
||||
# aa: the egress sends every token (LOS and gm_only ignored) | ab: gm_only ignored in the view rule
|
||||
# Walls r1 (#52): s1 preset xor raw switches | s2 a secret on a non-door is storable | s3 a window
|
||||
# blocks sight | s4 the one-way blind side is flipped | s5 an opening secret/locked door is accepted
|
||||
# | s6 the marker signature ignores thickness | s7 every refresh retracts the marker
|
||||
# ac: a controlled token is not always visible | ad: no token_gone when a token leaves view
|
||||
# ae: a player token frame carries the GM-only `kind` | af: explored forgets the cells outside the current polygon
|
||||
# ag: the chunk row stride is dropped | ah: a cell coordinate used as a chunk coordinate | ai: restore forgets rows
|
||||
@@ -137,11 +140,27 @@ TW="never reuses|id counter survives"
|
||||
run t "wall removal renumbers next_wall_id" server/world.nim 's/^ sc\.walls\.delete idx\.get$/ sc.walls.delete idx.get; sc.nextWallId = sc.walls.len + 1/' "$TW"
|
||||
run u "the id counter is not loaded from the DB" server/world.nim 's/nextWallId: parseInt(row\[10\])/nextWallId: 1/' "$TW"
|
||||
run v "the id counter is never written to the DB" server/world.nim '/db.exec(sql"UPDATE scene SET next_wall_id/d' "$TW"
|
||||
run w "a wall may stay open" server/world.nim 's/^ if result\.kind == wkWall: result\.open = false$/ discard/' "a wall is never open"
|
||||
run w "a wall may stay open" server/world.nim 's/^ if not result\.door:$/ if false:/' "a wall is never open"
|
||||
run x "zero-length walls accepted" server/world.nim 's/ (rec\.a\.x != rec\.b\.x or rec\.a\.y != rec\.b\.y) and inBounds/ inBounds/' "zero-length wall"
|
||||
run y "wall endpoints unchecked against the world bounds" server/world.nim 's/p\.x >= 0 and p\.y >= 0 and p\.x <= sc\.w and p\.y <= sc\.h/p.x >= 0 and p.y >= 0/' "both endpoints must be inside"
|
||||
run z "door.set accepted on a plain wall" server/world.nim '/if sc.walls\[idx.get\].kind != wkDoor: return waNotDoor/d' "wrong kinds are their own"
|
||||
run z2 "persisted open state loaded inverted" server/world.nim 's/open: row\[6\] == "1",/open: row[6] == "0",/' "round-trip through a reload"
|
||||
run z "door.set accepted on a plain wall" server/world.nim '/^ if current\.door == false: return waNotDoor$/d' "wrong kinds are their own"
|
||||
run z2 "persisted open state loaded inverted" server/world.nim 's/open: row\[12\] == "1",/open: row[12] == "0",/' "round-trip through a reload"
|
||||
# Walls r1 (#52): the typed record's one resolve path, the switch-set invariants, the sight gates
|
||||
# and the marker cause signature/retraction. Each is a clean in-process kill.
|
||||
RS="presets expand to switches only through the one resolve path"
|
||||
SS="the switch-set invariants reject door-only settings on a non-door"
|
||||
SG="storable is the last gate"
|
||||
OW="one-way: sight_dir names the blind side"
|
||||
SD="door.set refuses to open a secret or locked door"
|
||||
MR="a geometry change retracts"
|
||||
MS="an untouched marker survives"
|
||||
run s1 "a preset may ride along with raw switches" server/world.nim 's/if sw\.hasAny[A-Za-z]*: return none(WallRec)/discard/' "$RS"
|
||||
run s2 "a secret on a non-door is storable" server/world.nim '/^ if rec\.secret and not rec\.door: return false$/d' "$SG"
|
||||
run s3 "a window still blocks sight" server/world.nim 's/^ result\.blocksSight = false$/ result.blocksSight = true/' "$RS"
|
||||
run s4 "the blind side becomes the seeing side" server/geometry.nim 's/^ of wdLeft: s >= -Eps$/ of wdLeft: s <= Eps/' "$OW"
|
||||
run s5 "an opening secret or locked door is accepted" server/world.nim 's/if open and (current\.secret or current\.locked): return waInvalid/discard/' "$SD"
|
||||
run s6 "the marker signature ignores thickness" server/world.nim 's/thickness: w\.thickness, //' "$MR"
|
||||
run s7 "every refresh retracts the marker" server/markers.nim 's/if not byId\.hasKey(wallId) or pv\.markers\[wallId\]\.sig != markerSig(byId\[wallId\]):/if true:/' "$MS"
|
||||
# slice 5 (#20): the view rule, the egress diff and the explored set
|
||||
run aa "the egress ignores LOS, gm_only and ownership" server/views.nim 's/^ if not pv\[\]\.visibleTo(t, playerId): continue$/ if false: continue/' "$AA"
|
||||
run ab "gm_only ignored by the view rule" server/vision.nim '/^ if t\.gmOnly: return false$/d' "$AB"
|
||||
@@ -163,7 +182,7 @@ run ao "a shrink never clears the walls entries" server/moverules.nim 's/^ sc
|
||||
run ap "the property cap is not enforced" server/props.nim '/and p\[bucket\]\.len >= MaxPropKeys/d' "64 keys per bucket|the 65th"
|
||||
run aq "the grow push is skipped" server/moverules.nim 's/^ if not grew:$/ if true:/' "grow inside r of a wall pushes it out"
|
||||
run ar "a failed grow is not flagged squeezed" server/moverules.nim '/^ sc.tokens\[ti\]\.squeezedWalls = true$/d' "grow with no room on either side squeezes"
|
||||
run as "a failed door push sticks instead of squeezing" server/moverules.nim 's/^ sc.tokens\[i\]\.squeezedWalls = true$/ sc.tokens[i].stuckWalls = true/' "push: both sides invalid"
|
||||
run as "a failed door push sticks instead of squeezing" server/moverules.nim 's/^ sc.tokens\[i\]\.squeezedWalls = true$/ sc.tokens[i].stuckWalls = true/' "push: both sides invalid"
|
||||
run at "one bucket budget shared by all buckets" server/props.nim 's/and p\[bucket\]\.len >= MaxPropKeys/and p[pbPublic].len >= MaxPropKeys/' "64 keys per bucket"
|
||||
run au "a grow that already fits still pushes" server/moverules.nim 's/^ if not overlapsAny(sc, sc.tokens\[ti\]):$/ if false:/' "a grow that already fits does not move the token"
|
||||
# slice 8 (#23): the name rule, the encountered snapshot, the token link, in-use, the transfer and
|
||||
@@ -193,7 +212,9 @@ run d3 "scene.set accepts a patch with no field" server/world.nim 's/^ if not a
|
||||
wait
|
||||
|
||||
rc=0; : > "$LOG"
|
||||
for id in control a b c d1 d2 d3 e e1 e2 e3 f g h i j k l m n o p q r s t u v w x y z z2 aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az b1 b2 b3 b4 c1 c2 c3 c4; do
|
||||
for id in control a b c d1 d2 d3 e e1 e2 e3 f g h i j k l m n o p q r s t u v w x y z z2 \
|
||||
s1 s2 s3 s4 s5 s6 s7 aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au \
|
||||
av aw ax ay az b1 b2 b3 b4 c1 c2 c3 c4; do
|
||||
[ -f "$T/$id/res" ] && cat "$T/$id/res" >> "$LOG"
|
||||
if [ -f "$T/$id/verdict" ]; then tee -a "$LOG" < "$T/$id/verdict"; [ "$(cat "$T/$id/rc")" = 0 ] || rc=1
|
||||
else echo "$id: NO RESULT (job killed?)" | tee -a "$LOG"; rc=1; fi
|
||||
|
||||
Reference in New Issue
Block a user