Hygiene B6b: convert leaky-world tests + HudSystem cosmetics
- 10 EditMode files: every bare trailing world.Dispose() now inside using(world){} (single-world) or a [TearDown]+List<World> (the multi-world reject-matrix tests in BoonApplyTests/RouteSelectSystemTests) — an assertion failure can no longer leak the World and mask the true first failure. No test logic changed.
- HudSystem: collapse the blank-line run before the class close; trim the extracted route-map clause from the READY-panel comment.
466/466 EditMode tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,8 @@ namespace ProjectM.Tests
|
||||
public void Spawns_OncePerRoomEpoch_PlanCount_TaggedInShape_ScalePreserved()
|
||||
{
|
||||
var (world, group, dir, spawnerE, prefab) = MakeWorld(nodeBudget: 12);
|
||||
using (world)
|
||||
{
|
||||
var em = world.EntityManager;
|
||||
var map = RunMapMath.Generate(Seed);
|
||||
var plan = RoomLayoutMath.Plan(map.NodeAt(RunMap.NodeId(0, 0)), 0, map.LayerCount);
|
||||
@@ -100,13 +102,15 @@ namespace ProjectM.Tests
|
||||
|
||||
group.Update(); // same RoomEpoch — must NOT scatter again
|
||||
Assert.AreEqual(expected, LiveNodes(em), "int-equality reseed: one scatter per RoomEpoch");
|
||||
world.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Budget_FloorsSpawnCount_AndExhausts()
|
||||
{
|
||||
var (world, group, dir, spawnerE, prefab) = MakeWorld(nodeBudget: 1);
|
||||
using (world)
|
||||
{
|
||||
var em = world.EntityManager;
|
||||
|
||||
group.Update();
|
||||
@@ -125,13 +129,15 @@ namespace ProjectM.Tests
|
||||
|
||||
group.Update();
|
||||
Assert.AreEqual(1, LiveNodes(em), "a dry budget spawns nothing (scarcity holds run-wide)");
|
||||
world.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StagingSweep_KillsRoomGhosts_SparesUntagged()
|
||||
{
|
||||
var (world, group, dir, spawnerE, prefab) = MakeWorld(nodeBudget: 12);
|
||||
using (world)
|
||||
{
|
||||
var em = world.EntityManager;
|
||||
group.Update();
|
||||
Assert.Greater(LiveNodes(em), 0, "room content exists");
|
||||
@@ -147,7 +153,7 @@ namespace ProjectM.Tests
|
||||
group.Update();
|
||||
Assert.AreEqual(0, LiveNodes(em), "Staging sweep cleared every room ghost");
|
||||
Assert.IsTrue(em.Exists(baseNode), "untagged entities survive (the old base-field regression, structural now)");
|
||||
world.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user