add an all-in-one script for running tests; format and fix some code; add ci.yml
CI / main-server (RSpec + audits) (push) Failing after 1m12s
CI / game-server (go vet + go test -race) (push) Successful in 1m1s
CI / frontend (build + tests) (push) Successful in 9s

This commit is contained in:
2026-11-29 16:46:27 +03:00
parent a91eccbeaa
commit e52178c929
14 changed files with 474 additions and 139 deletions
+4 -5
View File
@@ -199,10 +199,10 @@ func ParsePlaceShips(args []json.RawMessage) ([]Ship, error) {
}
// ValidateShips validates the ship placement on the 10x10 board:
// - exactly 10 ships with sizes [1, 1, 1, 1, 2, 2, 2, 3, 3, 4]
// - all ship cells are within bounds (0 <= x < 10, 0 <= y < 10)
// - no ships overlap or touch each other in any direction (including diagonals),
// ensuring a gap of at least 1 cell between any two ships.
// - exactly 10 ships with sizes [1, 1, 1, 1, 2, 2, 2, 3, 3, 4]
// - all ship cells are within bounds (0 <= x < 10, 0 <= y < 10)
// - no ships overlap or touch each other in any direction (including diagonals),
// ensuring a gap of at least 1 cell between any two ships.
func ValidateShips(ships []Ship) error {
if len(ships) != ShipCount {
return fmt.Errorf("expected %d ships, got %d", ShipCount, len(ships))
@@ -327,4 +327,3 @@ func ParseFireResult(args []json.RawMessage) (seq int64, result int, err error)
func BuildFireResult(seq int64, result int) []byte {
return build([]any{OpFireResult, seq, result})
}
@@ -348,4 +348,3 @@ func TestParseFireResultErrors(t *testing.T) {
}
})
}