mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-28 09:54:43 +02:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user