From 9376e5fcc0561ff492d3df29c0d4255db4dcd058 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 16 Oct 2026 22:07:11 +0200 Subject: [PATCH] WellLawTests: the three-subzone fixture puts the big sun off the origin and pins each subzone's reach The first fixture hid the big sun's weight in the barycentre (it stood at the origin) and tested reach with two roots only, where nearest and farthest coincide. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/WellLawTests.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/WellLawTests.cs b/tests/Aetheria.Shared.Tests/WellLawTests.cs index 96169d517..8a9d76bff 100644 --- a/tests/Aetheria.Shared.Tests/WellLawTests.cs +++ b/tests/Aetheria.Shared.Tests/WellLawTests.cs @@ -190,7 +190,7 @@ public sealed class WellLawTests : IDisposable private Zone ThreeSubzones(out CultRecordKey[] roots) { var w = _worlds.New(); - var big = w.Orbit(default, 0f); + var big = w.Orbit(default, 3000f, .85f); w.Body(big, 5000f); w.Body(w.Orbit(big, 800f), 100f); var small = w.Orbit(default, 9000f, .3f); @@ -213,6 +213,13 @@ public sealed class WellLawTests : IDisposable for (var i = 0; i < roots.Length; i++) centre += zone.Orbits[roots[i]].Position * ThreeSubzoneMass[i] / 6100f; Assert.InRange(length(zone.Wells.Centre - centre), 0f, 1e-3f); + // Each subzone reaches half the way to its nearest neighbour, or 1.5 of its support if more. + for (var i = 0; i < roots.Length; i++) + { + var nearest = Enumerable.Range(0, roots.Length).Where(j => j != i).Min(j => length(zone.Orbits[roots[j]].Position - zone.Orbits[roots[i]].Position)); + Assert.Equal(Math.Max(.5f * nearest, 1.5f * zone.Wells.Support(roots[i])), zone.Wells.Reach(roots[i]), 2); + } + var far = 10f * zone.Pack.Radius; foreach (var angle in new[] { 0f, 2.1f, 4.4f }) Near(ZoneWorlds.Curves().WellStrength.Evaluate(6100f),