Gravity subtract tests: pin the well fixture to the bowl it replaced

The five bowl fixtures compare to the zone's own normal, so nothing pinned
the shared well's depth or radius to the bowl (a depth-scaled fixture
mutant survived). TheWellFixtureReproducesTheFormerBowl checks heights
against the bowl's own definition. This commit's test has not run yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-14 20:30:28 +02:00
commit 36d2dd45f2

View file

@ -72,6 +72,26 @@ public sealed class GravitySubtractTests : IDisposable
}
}
// The fixture the five bowl tests share reproduces the zone bowl it replaced (map B14): the bowl was
// -PowerPulse(r / (2 R), exponent) x depth, written out here from its definition, deepest at the centre and
// zero from r = R on, so a fixture whose radius or depth drifted from the bowl would change every pull it feeds.
[Fact]
public void TheWellFixtureReproducesTheFormerBowl()
{
foreach (var (radius, depth, exponent, at, expected) in new[]
{
(1000f, 1000f, 1f, 0f, -1000f), (1000f, 1000f, 1f, 400f, -840f), (1000f, 1000f, 1f, 1000f, 0f),
(2000f, 64f, 2f, 1000f, -36f), (2000f, 64f, 2f, 300f, -61.1524f)
})
{
var planets = Planets();
var pack = new ZonePack { Radius = radius };
WellFixture.Dig(_cache, pack, planets, radius, depth, exponent);
var zone = new Zone(_items, planets, pack, new GalaxyZone { Name = "Bowl Zone", Owner = null }, null);
Assert.InRange(zone.GetHeight(new float2(at, 0)), expected - 1e-2f, expected + 1e-2f);
}
}
// One body of `data` at the origin of a zone whose only body it is.
private Zone WithBody(BodyData data)
{