fix(client): address PR #13 review — LOS tests, reset consistency, docs
- Use reset_test_state() consistently in test_snapshot_parsing.gd (Tyre critical) - Fix misleading wall comment: (12,9) → (12,10) (Hoshe warning) - Add coordinate space documentation to _test_snapshot() (Tyre warning) - Add 4 Bresenham LOS unit tests: clear, blocked, diagonal, self (Hoshe warning) - Check OS.is_process_running() in connection loop (Hoshe warning) - Verify NPC position in corner reveal test (Hoshe suggestion) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,9 @@ func _connect_to_server() -> bool:
|
||||
_bridge = LocalBridge.new()
|
||||
var elapsed := 0.0
|
||||
while elapsed < CONNECT_TIMEOUT:
|
||||
if _server_pid > 0 and not OS.is_process_running(_server_pid):
|
||||
push_warning("Server process died during connection")
|
||||
return false
|
||||
if _bridge.get_status() == StreamPeerTCP.STATUS_NONE:
|
||||
_bridge.connect_to_server("127.0.0.1", _test_port)
|
||||
_bridge.poll()
|
||||
@@ -174,6 +177,8 @@ func test_proof_corner_reveal() -> void:
|
||||
var npc_found := false
|
||||
for entity in snapshot.entities:
|
||||
if entity.kind.variant == "Npc":
|
||||
assert_float(entity.x).is_equal_approx(16.5, 0.001)
|
||||
assert_float(entity.y).is_equal_approx(13.5, 0.001)
|
||||
npc_found = true
|
||||
break
|
||||
assert_that(npc_found).is_true()
|
||||
|
||||
Reference in New Issue
Block a user