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:
2026-07-08 21:06:33 -07:00
parent 6379f5d897
commit e27a495530
11 changed files with 128 additions and 62 deletions
@@ -93,6 +93,8 @@ static int RoomEntities(EntityManager em)
public void Cleared_LootWindowThenPortalAdvances_WithSlotFlipAndEpochBump()
{
var (world, group, dir, player) = MakeMidRunWorld(0, out var map);
using (world)
{
var em = world.EntityManager;
var node0 = em.CreateEntity(typeof(RoomTag));
em.SetComponentData(node0, new RoomTag { Room = 0 });
@@ -132,7 +134,7 @@ static int RoomEntities(EntityManager em)
Assert.AreEqual(0, em.GetComponentData<RouteCommand>(dir).HasPick, "latch consumed");
Assert.AreEqual(0, (int)info.RouteOptionCount, "gate closed on advance");
Assert.GreaterOrEqual(em.GetComponentData<LocalTransform>(player).Position.x, 1499f, "party teleported (+1500)");
world.Dispose();
}
}
[Test]
@@ -140,6 +142,8 @@ static int RoomEntities(EntityManager em)
{
RunMap map0;
var (world, group, dir, player) = MakeMidRunWorld(0, out map0);
using (world)
{
var em = world.EntityManager;
int bossLayer = map0.LayerCount - 1;
var info0 = em.GetComponentData<RunInfo>(dir);
@@ -174,13 +178,15 @@ static int RoomEntities(EntityManager em)
group.Update();
Assert.AreEqual(1, em.GetComponentData<GoalProgress>(dir).Charge, "no double credit (F7)");
Assert.AreEqual(1, em.GetComponentData<MetaCounters>(dir).RunsCompleted);
world.Dispose();
}
}
[Test]
public void Abort_BanksDepthOnly_NoWinCredit()
{
var (world, group, dir, player) = MakeMidRunWorld(2, out var map);
using (world)
{
var em = world.EntityManager;
// All expedition players gone mid-room-2 (rooms 0-1 cleared) -> abort.
em.SetComponentData(player, new RegionTag { Region = RegionId.Base });
@@ -196,13 +202,15 @@ static int RoomEntities(EntityManager em)
var threat = em.GetComponentData<ThreatState>(dir);
Assert.AreEqual(0, threat.PendingReturns, "no retaliation provoked by an abort");
Assert.AreEqual(0, em.GetComponentData<SaveRequest>(dir).Pending, "no save spam on abort");
world.Dispose();
}
}
[Test]
public void RouteGate_PickBeatsSameTickGrace()
{
var (world, group, dir, player) = MakeMidRunWorld(0, out var map);
using (world)
{
var em = world.EntityManager;
MarkCleared(em, dir);
group.Update();
@@ -221,13 +229,15 @@ static int RoomEntities(EntityManager em)
var info = em.GetComponentData<RunInfo>(dir);
Assert.AreEqual(RunLifecycle.InRoom, info.Lifecycle);
Assert.AreEqual(pickedCol, info.CurrentCol, "the accepted pick beats the same-tick grace expiry");
world.Dispose();
}
}
[Test]
public void RouteGate_GraceAutoPicksLowestOption()
{
var (world, group, dir, player) = MakeMidRunWorld(0, out var map);
using (world)
{
var em = world.EntityManager;
MarkCleared(em, dir);
group.Update();
@@ -242,13 +252,15 @@ static int RoomEntities(EntityManager em)
var info = em.GetComponentData<RunInfo>(dir);
Assert.AreEqual(RunLifecycle.InRoom, info.Lifecycle, "the AFK backstop advances the run");
Assert.AreEqual(lowestCol, info.CurrentCol, "deterministic lowest-index reachable auto-pick");
world.Dispose();
}
}
[Test]
public void RouteGate_Abort_ClosesGateOnTheEdge()
{
var (world, group, dir, player) = MakeMidRunWorld(0, out var map);
using (world)
{
var em = world.EntityManager;
MarkCleared(em, dir);
group.Update();
@@ -262,7 +274,7 @@ static int RoomEntities(EntityManager em)
var info = em.GetComponentData<RunInfo>(dir);
Assert.AreEqual(RunLifecycle.Returning, info.Lifecycle);
Assert.AreEqual(0, (int)info.RouteOptionCount, "gate closed ON the abort edge (review F3)");
world.Dispose();
}
}
}
}