test: assert seed-log fields, not a fresh LogPlayer

The previous regression tests in test_entities.gd only constructed their
own LogPlayer and never touched the seed logs the real call sites build
— reverting main_window_shell.gd:124 to the broken 3-arg call still left
the whole suite green. Not a real regression guard.

Now assert against node._log.player in the shell test and against the
two dev-harness scenes' seed logs (narrate_harness, npc_harness — both
cheaply testable via instantiate + add_child_autofree, no scaffolding
needed). Proved the new shell assertion fails when the call site is
reverted to the 3-arg shape (226/227, one failure), then passes restored
(227/227). Removed a redundant ctor test from test_entities.gd; kept the
one that exercises the exact broken-shape call.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYa9u7Kdxv5gX4AnwWexy8
This commit is contained in:
2026-07-12 20:39:48 -05:00
parent 5149e817f6
commit eba706b906
4 changed files with 38 additions and 13 deletions

View File

@@ -32,19 +32,6 @@ func test_log_player_rejects_a_dead_calling():
assert_true(p.set_race_id("dwarf"))
func test_log_player_ctor_populates_both_race_and_calling():
# Regression: three call sites once passed the OLD 3-arg (name, class_id,
# luck_descriptor) shape against the NEW 4-arg (name, race_id, calling_id,
# luck_descriptor) constructor. Every param has a default, so GDScript
# compiled it silently — the string meant as a calling landed in the
# race_id slot, got rejected, and both fields came out "". This asserts
# a properly-shaped call yields BOTH fields non-empty.
var p := LogPlayer.new("Aldric", "human", "sellsword", "Fortune spits on you")
var d := p.to_dict()
assert_ne(d["race_id"], "", "race_id must not be empty")
assert_ne(d["calling_id"], "", "calling_id must not be empty")
func test_log_player_ctor_rejects_calling_passed_as_race():
# The exact shape of the bug: calling three broken call sites used to pass —
# LogPlayer.new(name, class_id, luck_descriptor) against the NEW ctor