Ruined
This commit is contained in:
+74
-12
@@ -266,7 +266,7 @@ test("biome and diversity integration is unique, complete and ordered before sea
|
||||
assert(seen.hearth_temperate and seen.hearth_riverbank and seen.hearth_rocky_peaks)
|
||||
local index = {}
|
||||
for i, name in ipairs(registrations) do index[name] = i end
|
||||
eq(#hearth.biomes.species_order,10)
|
||||
eq(#hearth.biomes.species_order,13)
|
||||
eq(table.concat(hearth.biomes.species_order,","),table.concat(hearth.diversity.species_order,","))
|
||||
for _, species in ipairs(hearth.biomes.species_order) do
|
||||
for _, part in ipairs({"log", "leaves", "planks", "seedling", "young", "mature"}) do
|
||||
@@ -286,7 +286,7 @@ test("biome and diversity integration is unique, complete and ordered before sea
|
||||
end
|
||||
assert(index["hearth:oak_leaves"] < index["hearth:oak_seedling"])
|
||||
assert(index["hearth:lichen"] < index["hearth:oak_leaves_winter"])
|
||||
eq(#hearth.botany.catalogue,80)
|
||||
eq(#hearth.botany.catalogue,100)
|
||||
local botany_nodes=0
|
||||
for _,record in ipairs(hearth.botany.catalogue) do
|
||||
assert(nodes[record.node],record.node)
|
||||
@@ -297,7 +297,7 @@ test("biome and diversity integration is unique, complete and ordered before sea
|
||||
eq(def.tiles[1],record.texture); eq(def.inventory_image,record.texture); eq(def.wield_image,record.texture)
|
||||
end
|
||||
end
|
||||
eq(botany_nodes,62)
|
||||
eq(botany_nodes,79)
|
||||
for _, name in ipairs(hearth.diversity.plants) do assert(nodes["hearth:" .. name]) end
|
||||
eq(hearth.diversity.supports_species("pine", "podzol"), true)
|
||||
eq(hearth.diversity.supports_species("oak", "podzol"), false)
|
||||
@@ -372,12 +372,12 @@ test("all species and rocks keep single-item products and pair-only mass-preserv
|
||||
exact("hearth:planks 4", {"hearth:log"})
|
||||
exact("hearth:sticks 4", {"hearth:planks"})
|
||||
end)
|
||||
test("all 78 registered recipes close uniquely with exact output names and counts", function()
|
||||
test("all 87 registered recipes close uniquely with exact output names and counts", function()
|
||||
-- Exact-name registrations only. Compare shaped bounding boxes, and compare
|
||||
-- ingredient multisets whenever either recipe is shapeless. This catches
|
||||
-- single-input collisions even across craft types without pretending to be
|
||||
-- the native resolver (the native smoke still calls get_craft_result).
|
||||
eq(#crafts,78)
|
||||
eq(#crafts,87)
|
||||
local signatures, outputs={},{}
|
||||
for i, def in ipairs(crafts) do
|
||||
assert(def.type==nil or def.type=="shapeless", "unsupported craft type")
|
||||
@@ -405,7 +405,7 @@ test("all 78 registered recipes close uniquely with exact output names and count
|
||||
shapeless=def.type=="shapeless", name=result:get_name(), count=result:get_count()}
|
||||
end
|
||||
local output_count=0; for _ in pairs(outputs) do output_count=output_count+1 end
|
||||
eq(output_count,52)
|
||||
eq(output_count,55)
|
||||
for i, expected in ipairs(signatures) do
|
||||
local matches=0
|
||||
for j, candidate in ipairs(signatures) do
|
||||
@@ -965,14 +965,16 @@ test("botanical silhouettes have crisp alpha and waving without losing ecosystem
|
||||
end
|
||||
eq(nodes["hearth:torch"].use_texture_alpha, "clip")
|
||||
end)
|
||||
test("fauna register the original species meshes at node scale", function()
|
||||
for _, kind in ipairs({"hare", "fox", "deer"}) do
|
||||
local def = assert(entities["hearth:" .. kind], kind)
|
||||
test("all 23 fauna register the actual animated catalogue assets at node scale", function()
|
||||
for _, r in ipairs(hearth.fauna.list()) do
|
||||
local def = assert(entities[r.entity], r.id)
|
||||
local props = def.initial_properties
|
||||
eq(props.visual, "mesh"); eq(props.mesh, "hearth_" .. kind .. ".obj")
|
||||
eq(#props.textures, 1); eq(props.textures[1], "hearth_" .. kind .. ".png")
|
||||
eq(props.visual, "mesh"); eq(props.mesh, r.mesh)
|
||||
eq(#props.textures, 1); eq(props.textures[1], r.texture)
|
||||
eq(props.visual_size.x, 1); eq(props.visual_size.y, 1)
|
||||
eq(props.collisionbox[2], 0); eq(props.static_save, false)
|
||||
eq(props.collisionbox[2], 0); eq(props.static_save, true)
|
||||
eq(r.frames,100); eq(r.fps,24)
|
||||
assert(def.get_staticdata and def.on_step)
|
||||
end
|
||||
end)
|
||||
test("local art registrars do not wrap global APIs or require optional mock registries", function()
|
||||
@@ -1068,5 +1070,65 @@ test("drying racks require a shared claim and cloaks toggle persistent player pr
|
||||
eq(player_meta:get_int("hearth:cloak"), 0)
|
||||
end)
|
||||
|
||||
test("real factory wiring publishes calendar policy and the exact wildlife fauna catalogue",function()
|
||||
local L=assert(hearth.lifecycle)
|
||||
eq(L.SECONDS_PER_DAY,86400); eq(L.DAYS_PER_YEAR,365.2425)
|
||||
eq(#L.ids("plant"),100); eq(#L.ids("animal"),23)
|
||||
eq(hearth.fauna,hearth.wildlife.fauna)
|
||||
eq(#hearth.fauna.list(),23)
|
||||
local status=hearth.wildlife.status(); eq(status.species_count,23)
|
||||
local breeding={bank_vole=true,wood_mouse=true,blackbird=true,mallard=true,hare=true,fox=true}
|
||||
for _,r in ipairs(hearth.fauna.list()) do
|
||||
assert(entities[r.entity] and status.counts[r.id]==0,r.id)
|
||||
assert(r.profile and r.profile.reproduction_enabled==(breeding[r.id]==true),r.id)
|
||||
assert(not hearth.fauna.can_breed(r.id,1782043200,1782043200,"female"),"Newborn must not breed: "..r.id)
|
||||
end
|
||||
-- UTC dates: 2026-06-21 and 2027-06-21, NOT dates built in local time.
|
||||
local phase=L.phase(L.plant("oak"),1782043200,1813579200)
|
||||
eq(phase.age_days,365); eq(phase.death_due,false)
|
||||
local groups={trees=13,shrubs=14,grasses=10,herbs=22,ferns_mosses=11,fungi=10,aquatic=10,lichens=10}
|
||||
for _,r in ipairs(hearth.botany.list()) do
|
||||
local profile=assert(L.plant(r.id,r.group)); eq(profile.id,r.id)
|
||||
eq(profile.kind,"plant"); eq(profile.group,r.group)
|
||||
assert(type(profile.confidence)=="string" and type(profile.evidence)=="table")
|
||||
for _,field in ipairs({"germination_days","juvenile_days","maturity_days","lifespan_days"}) do
|
||||
local range=profile[field]
|
||||
assert(range==false or (type(range)=="table" and range.min>=0 and range.max>=range.min
|
||||
and type(range.confidence)=="string" and range.source_url~=nil),r.id..":"..field)
|
||||
end
|
||||
local start=assert(L.phase(profile,1782043200,1782043200)); eq(start.age_days,0)
|
||||
local after=assert(L.phase(profile,1782043200,1813579200)); eq(after.age_days,365)
|
||||
eq(after.death_due,false); assert(L.resolve(profile,731104),r.id)
|
||||
eq(#hearth.botany.list(r.group),groups[r.group])
|
||||
assert(nodes[r.node],r.node)
|
||||
if r.group=="trees" then
|
||||
for _,part in ipairs({"seedling","young","mature","log","leaves","planks"}) do
|
||||
eq(hearth.botany.kind("hearth:"..r.id.."_"..part),r.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
test("actual pollination and frugivore transactions share the human annual fruit budget",function()
|
||||
local old_climate,old_allowed=hearth.climate_at,hearth.claim_allowed
|
||||
hearth.climate_at=function() return {season="Summer"} end
|
||||
hearth.claim_allowed=function() return true end
|
||||
claim=false; now=1782043200
|
||||
local p=pos(0,1,0); put(pos(),"hearth:grass"); put(p,"hearth:bilberry")
|
||||
local m=core.get_meta(p); m:set_string("succ_natural","1")
|
||||
assert(hearth.succession.pollinate(p)) -- requires lifecycle captured at construction
|
||||
eq(tonumber(m:get_string("succ_pollinated_until")),now+86400)
|
||||
local ok,n=hearth.botany.harvest(p,player); assert(ok); eq(n,3)
|
||||
eq(m:get_string("succ_pollinated_until"),"0")
|
||||
local deadline=now+365.2425*86400
|
||||
eq(tonumber(m:get_string("botany_ready_at")),deadline)
|
||||
assert(not hearth.succession.frugivore(p,"bilberry"))
|
||||
now=deadline; assert(hearth.succession.frugivore(p,"bilberry"))
|
||||
eq(tonumber(m:get_string("botany_ready_at")),now+365.2425*86400)
|
||||
assert(not hearth.botany.harvest(p,player))
|
||||
hearth.climate_at,hearth.claim_allowed=old_climate,old_allowed
|
||||
end)
|
||||
|
||||
os.time = real_time
|
||||
assert(passed==40,"Unexpected focused content integration count")
|
||||
print("1.." .. passed)
|
||||
|
||||
Reference in New Issue
Block a user