From 36d2dd45f21c8efc8dba62b87949c6fe1989e299 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 14 Oct 2026 20:30:28 +0200 Subject: [PATCH] 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 --- .../GravitySubtractTests.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/GravitySubtractTests.cs b/tests/Aetheria.Shared.Tests/GravitySubtractTests.cs index a513aad59..8f23c1f6e 100644 --- a/tests/Aetheria.Shared.Tests/GravitySubtractTests.cs +++ b/tests/Aetheria.Shared.Tests/GravitySubtractTests.cs @@ -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) {