feat(marksilo): 'Kør overskud til produktion' — foder først: staldenes forbrug × valgt antal døgn bliver på gården, overskud køres til gårdens fabrikker (v1.44.0.0)

This commit is contained in:
2026-09-27 22:19:26 +02:00
parent 5e1d6a3659
commit 6aeb8e4179
10 changed files with 191 additions and 22 deletions
+13
View File
@@ -29,5 +29,18 @@ check("record: x", back.maxVehicles, 4)
check("record: tærskel", back.minLiters, 25000)
check("tom record -> standard", C.fromRecord(nil).maxVehicles, 2)
check("record uden tal -> standard tærskel", C.fromRecord({enabled = 1}).minLiters, 10000)
-- kør til produktion + foderreserve
check("standard: ikke til produktion", cfg.toProduction, false)
check("standard foderreserve 7 døgn", cfg.reserveDays, 7)
check("reserve snappes (10 -> 7)", C.with(cfg, {reserveDays = 10}).reserveDays, 7)
check("reserve 40 -> 30", C.with(cfg, {reserveDays = 40}).reserveDays, 30)
local prod = C.with(C.toggleStore(cfg, "a"), {toProduction = true, reserveDays = 14})
check("with bevarer lagre", C.hasStore(prod, "a"), true)
check("with muterer ikke (produktion)", cfg.toProduction, false)
local prodBack = C.fromRecord(C.toRecord(prod))
check("record: til produktion", prodBack.toProduction, true)
check("record: foderreserve", prodBack.reserveDays, 14)
check("gammel record uden felter -> standard", C.fromRecord({enabled = 1}).reserveDays, 7)
check("toggleStore bevarer produktion", C.toggleStore(prod, "b").toProduction, true)
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)