Skip to content

Commit cec5581

Browse files
committed
test(log): fix bug with game_state_before in first step
1 parent e3bd157 commit cec5581

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/lua/test_log.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def normalize_step(step: dict[str, Any]) -> dict[str, Any]:
5050
card.pop("highlighted", None)
5151
card.pop("sort_id", None)
5252

53+
# we don't care about the game_state_before when starting a run
54+
if step.get("function", {}).get("name") == "start_run":
55+
normalized.pop("game_state_before", None)
56+
5357
return normalized
5458

5559

@@ -163,8 +167,6 @@ def test_compare_lua_logs_with_original_run(
163167

164168
# Compare each step
165169
for i, (original_step, lua_step) in enumerate(zip(orig_steps, lua_steps)):
166-
if i == 0:
167-
continue # BUG: The first game_state_before is not the same as the original
168170
context = f"step {i} in {original_jsonl.name} (Origianl vs Lua logs)"
169171
assert_steps_equal(lua_step, original_step, context)
170172

@@ -188,7 +190,5 @@ def test_compare_python_logs_with_original_run(
188190

189191
# Compare each step
190192
for i, (original_step, python_step) in enumerate(zip(orig_steps, python_steps)):
191-
if i == 0:
192-
continue # BUG: The first game_state_before is not the same as the original
193193
context = f"step {i} in {original_jsonl.name} (Original vs Python logs)"
194194
assert_steps_equal(python_step, original_step, context)

0 commit comments

Comments
 (0)