fix(client): address PR #40 review — 13 suggestions
- Rename _insert to insert_state in main.gd (Hoshe #1) - Add after_each() to test_bug_report_ring_buffer.gd for GameState cleanup on assertion failure (Hoshe #2) - Add after_each() to test_insert_off_behavior.gd for stance/interaction restore on assertion failure (Hoshe #3) - Fix assertion message: "unknown" → "unavailable" (Hoshe #4) - Document memory ceiling of 60 JSON snapshots in ring buffer (Hoshe #5) - Add precision warning for u64 rng_seed via JSON float (Hoshe #6) - Promote _action_enum_to_wire to public action_enum_to_wire (Tyre #1) - Add @warning_ignore for unused _tick parameter (Tyre #5) - Document insert_active assumption for future no-insert characters (Tyre #4) - Restructure OQ-07 decision amendments as bullet points (Tyre #7) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,21 @@ var BugReportDialogScript = load("res://ui/bug_report_dialog.gd")
|
||||
const EXPECTED_CAPACITY := 60
|
||||
|
||||
|
||||
func after_each() -> void:
|
||||
# Reset GameState fields mutated by tests to prevent cross-test leakage.
|
||||
GameState.current_tick = 0
|
||||
GameState.room_id = null
|
||||
GameState.player_stance = "Walk"
|
||||
GameState.player_facing = "South"
|
||||
GameState.player_position = Vector2.ZERO
|
||||
GameState.visible_entities = []
|
||||
GameState.visible_tiles = []
|
||||
GameState.game_time = {}
|
||||
GameState.current_monologue = null
|
||||
GameState.current_dialogue = null
|
||||
GameState.rng_seed = null
|
||||
|
||||
|
||||
# -- Helpers -------------------------------------------------------------------
|
||||
|
||||
func _make_dialog() -> Control:
|
||||
@@ -285,7 +300,7 @@ func test_seed_written_on_capture() -> void:
|
||||
# Should return some Variant (int or String) without crashing
|
||||
var seed_val = dialog._get_current_seed()
|
||||
assert_that(seed_val != null).override_failure_message(
|
||||
"_get_current_seed() must not return null (use 0 or 'unknown' if seed unavailable)"
|
||||
"_get_current_seed() must not return null (use 0 or 'unavailable' if seed unavailable)"
|
||||
).is_true()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user