potentially CLOSES #758

This commit is contained in:
bryanthaboi
2026-08-03 17:08:42 -04:00
parent b831076839
commit 76aab74bf1
5 changed files with 57 additions and 6 deletions
+19
View File
@@ -378,6 +378,25 @@ local nextEngine = Handshake.hello(fakeGame(vanilla, "BLUE"), nil)
nextEngine.engineVersion = "2.0.0"
eq(Handshake.checkCompat(helloA, nextEngine), "refused", "engine major mismatch refuses")
-- same major, different release: the fingerprint can't see engine code,
-- and battle logic changes between releases, so lockstep would desync a
-- few turns in (#758) -- battle is refused up front, trade still works
local skewed = Handshake.hello(fakeGame(vanilla, "BLUE"), nil)
skewed.engineVersion = (tostring(helloA.engineVersion):match("^(%d+)") or "0") .. ".999.0"
local skewVerdict, skewReason = Handshake.checkCompat(helloA, wire(skewed))
eq(skewVerdict, "engine_skew", "same-major release skew is its own verdict")
eq(skewReason, "engine_release_mismatch", "and says why")
check(not Handshake.battleAllowed("engine_skew"), "release skew refuses lockstep")
check(Handshake.tradeAllowed("engine_skew"), "release skew still trades")
check(Handshake.strict("engine_skew"), "release skew negotiates strictly")
local skewLines = Handshake.describe(helloA, wire(skewed), "engine_skew", "battle")
local skewJoined = table.concat(skewLines, " ")
check(skewJoined:find("version", 1, true) ~= nil, "skew notice mentions versions")
check(skewJoined:find("999", 1, true) ~= nil, "skew notice names the peer release")
for _, line in ipairs(skewLines) do
check(#line <= 20, "skew line fits the screen: " .. line)
end
local lines = Handshake.describe(helloA, wire(helloMod), "subset", "battle")
check(#lines > 0, "the incompatibility screen has something to say")
local joined = table.concat(lines, " ")