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 <noreply@anthropic.com>
This commit is contained in:
Colson Rice
2026-08-26 15:47:08 -04:00
parent fe31293566
commit 3a0a72102f
@@ -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"