From 3a0a72102fb9ab6b6dc375c3745604bb0240bca1 Mon Sep 17 00:00:00 2001 From: Colson Rice Date: Wed, 26 Aug 2026 15:47:08 -0400 Subject: [PATCH] Teach the bug420 SaveConvert double the method importToSlot now calls CI caught this: tests/engine/save_import_retry_bug420.lua replaces SaveConvert with a minimal double, and importToSlot now asks it importSupported before it measures the bytes, so the double answered nil and the call died. The double stands in for the real module, so it grows with it. Answering true keeps that case about the thing it is testing, which is that importToSlot names the game whose cache to read. ./scripts/test.sh passes end to end locally now, every ROM-free tier. Co-Authored-By: Claude Opus 5 --- tests/engine/save_import_retry_bug420.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/engine/save_import_retry_bug420.lua b/tests/engine/save_import_retry_bug420.lua index 46b955e3..bf14507c 100644 --- a/tests/engine/save_import_retry_bug420.lua +++ b/tests/engine/save_import_retry_bug420.lua @@ -221,6 +221,11 @@ do local seen = {} package.loaded["src.save_convert.SaveConvert"] = { SAVE_SIZE = 32768, + -- importToSlot asks this before it measures the bytes, so a save for a + -- game with no codec is refused as that rather than as a bad checksum. + -- The double has to answer it; "yes" is what keeps this case about the + -- cache-name contract below and nothing else. + importSupported = function() return true end, importSav = function(_, version, gameVersion) seen.import = { version = version, gameVersion = gameVersion } return nil, "stub"