RestoredHullsTests: a non-entrance no-Lagrange zone seats every dealt station at its root

Old reading 0 stations (the zone's roll was dropped where no rail could seat it); new reading 8, the deal's count for the boosted-presence fixture. The shortfall path is every zone's now, so the test asserts the count equals the deal's and that the deal is not empty.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-28 23:33:20 +01:00
commit f159acf1bb

View file

@ -851,8 +851,8 @@ public sealed class RestoredHullsTests
}
}
// Cut 1 fix batch 3 (F6, N2): the entrance-only widening must not leak to a non-entrance zone that would
// otherwise get zero stations. NoLagrangeCandidateZone's zone (the same no-Lagrange fixture the widened-candidate test
// Cut 1 fix batch 3 (F6, N2), re-pointed at region-chain-deck: this zone once got no station outside the entrance, the entrance-only
// widening holding back a non-entrance zone that rolled one; every dealt card is seated now, at the root. NoLagrangeCandidateZone's zone (the same no-Lagrange fixture the widened-candidate test
// above uses, this time NOT retargeted as Entrance) rolls a real, nonzero station count on its own -- forced
// here by boosting one faction's presence there (HomeZone distance 0, InfluenceDistance 50, so the roll's
// floor(rand * (factionPresence+1)) is overwhelmingly likely nonzero) via the same public SavedGame round
@ -900,7 +900,7 @@ public sealed class RestoredHullsTests
}
[Fact]
public void WideningDoesNotLeakToANonEntranceNoLagrangeZoneThatRollsAStation()
public void ANonEntranceNoLagrangeZoneSeatsEveryDealtStationAtItsRoot()
{
var gameData = TestCatalog.Repo;
var scratchRun = Path.Combine(Path.GetTempPath(), $"aetheria-widen-leak-{Guid.NewGuid():N}.cc");
@ -920,8 +920,12 @@ public sealed class RestoredHullsTests
var hasGenuineCandidate = HasGenuineLagrangeCandidate(ParentedPlanetOrbits(cache, pack));
Assert.False(hasGenuineCandidate, "the entrance-adjacent fixture zone now has a genuine Lagrange candidate; it no longer tests the no-Lagrange leak path.");
// Region-chain-deck: a station the rails cannot seat is no longer dropped outside the entrance. Every card the deal gives
// this zone (boosted presence deals it several) orbits the root, so the count is the deal's, never zero.
var dealt = StationDeck.Deal(galaxy, cache)[Array.IndexOf(galaxy.Zones, zone)].Length;
Assert.True(dealt > 0, "the boosted-presence fixture zone is dealt no station; it no longer probes the no-Lagrange seat");
var stationCount = pack.Entities.OfType<OrbitalEntityPack>().Count(e => (cache.Get(e.Hull.Data) as HullData)?.HullType == HullType.Station);
Assert.Equal(0, stationCount);
Assert.Equal(dealt, stationCount);
}
finally
{