mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
4533da34e0
Lands tasks 1.0-1.8 of multiplayer-todo.md: the pure-function test runner, net_codec (wire format quantizers/pack-unpack), NetworkManager (ENet transport, manual polling, min-RTT clock sync), MatchNet (handshake, protocol/tick-rate gating, roster with team+ready state), lobby.tscn (team columns, switch team, ready toggle), server_boot.tscn (headless dedicated server with structured logging and an overrun watchdog), and main_menu.gd's Host/Join-by-IP UI (connecting overlay, cancel, bounded failure path). Followed by an adversarial review (Opus subagent) that found and fixed two real bugs - an unvalidated player_name broadcast that let one client's oversized name head-of-line-block the reliable channel for everyone, and a server-side roster leak across a host/re-host cycle - plus three gaps in the test suite itself where a claim of "verified" wasn't actually backed by what the test checked. All five two-process smoke tests plus the pure-function suite are green with the strengthened assertions in place.
13 lines
362 B
GDScript
13 lines
362 B
GDScript
extends "res://tests/test_case.gd"
|
|
|
|
# Proves the runner itself works: discovery, dispatch, pass/fail aggregation.
|
|
|
|
func test_true_is_true() -> void:
|
|
assert_true(true, "true should be true")
|
|
|
|
func test_addition() -> void:
|
|
assert_eq(2 + 2, 4, "2 + 2")
|
|
|
|
func test_almost_eq_tolerance() -> void:
|
|
assert_almost_eq(1.0001, 1.0, 0.001, "1.0001 within 0.001 of 1.0")
|