tools: test nginx, generated tile fixtures and the tile group (#24)
This commit is contained in:
+12
-1
@@ -22,6 +22,9 @@
|
||||
# az: in-use not enforced | b1: player.remove forgets the characters | b2: an encountered rename
|
||||
# overwrites a name the player never knew | b3: cprops carries the character owner bucket |
|
||||
# b4: a player is sent every character
|
||||
# slice 9 (#24): the canonical tile URL and the "any explored cell allows" gate
|
||||
# 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
|
||||
# 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.
|
||||
@@ -169,10 +172,18 @@ run b1 "player.remove forgets the characters" server/characters.nim 's/WHERE own
|
||||
run b2 "an encountered rename overwrites a secret" server/characters.nim 's/AND actual_name <> .."""/AND 1 = 1"""/' "a character rename follows the snapshots"
|
||||
run b3 "cprops carries the character owner bucket" server/views.nim 's/cpropsPublic: objectOf(if ch\.isSome and not ownsCharacter: ch\.get\.props\[pbPublic\]/cpropsPublic: objectOf(if ch.isSome and not ownsCharacter: ch.get.props[pbOwner]/' "cprops carries the character"
|
||||
run b4 "a player is sent every character" server/views.nim 's/ if c\.owner != playerId: continue/ if false: continue/' "a player gets only its own characters"
|
||||
# slice 9 (#24): the tile URL grammar and the access rule (server/tiles.nim)
|
||||
TILE_GATE="an unexplored tile is refused|a tile is allowed when any overlapping cell"
|
||||
TILE_ZERO="leading zero tile coordinates"
|
||||
TILE_RANGE="outside the grid is out of range"
|
||||
run c1 "the tile gate ignores the explored set" server/tiles.nim 's/ if sc\.cellIndex(cx, cy) in explored: return true/ if true: return true/' "$TILE_GATE"
|
||||
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"
|
||||
wait
|
||||
|
||||
rc=0; : > "$LOG"
|
||||
for id in control a b c d1 d2 e 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; do
|
||||
for id in control a b c d1 d2 e 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
|
||||
[ -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