From 349a226c72adc571040f3fb9b6202d5f4b42f140 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 18 Oct 2026 07:18:37 +0200 Subject: [PATCH] MismatchedDrivesHoldHeading stages its two drive lots at .55 and .85 Heat now reads effective quality, which narrowed the Generated fit's drive spread below the test's 5 percent premise (probe: thermal exponents 1.227/.809 at base, 1.623/1.318 at head; NominalThrust ratio 1.0525 then 1.0436). The test fits the two Large Drives with lots staged at the low and high end of the makers' assembly range, chosen before any run, through the ship's own unequip and equip, and asserts the spread as a premise with its own message. Unverified until the Yggdrasil run. Co-Authored-By: Claude Sonnet 5.5 --- .../ThrustAllocationTests.cs | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ThrustAllocationTests.cs b/tests/Aetheria.Shared.Tests/ThrustAllocationTests.cs index 068ec2f40..c1772695b 100644 --- a/tests/Aetheria.Shared.Tests/ThrustAllocationTests.cs +++ b/tests/Aetheria.Shared.Tests/ThrustAllocationTests.cs @@ -38,17 +38,46 @@ public sealed partial class RunStartTests return degrees(SignedTurn(before, ship.Direction)); } + // The two Large Drives, refitted with lots staged at the low and high end of the makers' assembly range (.55 and .85, each + // with its parts at its assembly), so their effective qualities differ by construction. The lots are fitted through the + // ship's own unequip and equip, so heat, thrust and the allocator stay the production path. + private void StageDriveLots(Ship ship) + { + var drives = AllocDrives(ship).OrderBy(d => d.Item.Position.x).ToArray(); + Assert.Equal(2, drives.Length); + var assemblies = new[] { .55f, .85f }; + for (var i = 0; i < drives.Length; i++) + { + var fitted = drives[i].Item; + var unit = fitted.EquippableItem; + var lot = _items.GetLot(unit); + Assert.NotNull(ship.TryUnequip(fitted)); + var staged = new EquippableItem + { + Data = unit.Data, Durability = unit.Durability, Rotation = unit.Rotation, + Lot = _items.Lots.Add(new Lot + { + Design = lot.Design, Origin = lot.Origin, Product = lot.Product, Quality = assemblies[i], + Roles = (lot.Roles ?? new List()).Select(r => new RoleFill { Role = r.Role, Quality = assemblies[i] }).ToList() + }) + }; + Assert.True(ship.TryEquip(staged, fitted.Position)); + } + } + [Fact] public void MismatchedDrivesHoldHeading() { var (_, player) = AllocDuel(); + StageDriveLots(player); var drives = AllocDrives(player); player.MovementDirection = float2(0, 1); player.Turn = 0; - Assert.True(abs(AllocFly(player, 120)) < .1f); + var heading = AllocFly(player, 120); // The drives start alike and heat apart as they fire: by now they are mismatched and both pushing. - Assert.True(drives.Length >= 2 && drives[^1].NominalThrust > drives[0].NominalThrust * 1.05f, "fixture: the drives are mismatched"); - Assert.All(drives, d => Assert.True(d.Axis > .5f, "fixture: the drives are pushing")); + Assert.True(drives.Length >= 2 && drives[^1].NominalThrust > drives[0].NominalThrust * 1.05f, "premise: the drives' NominalThrust spread reaches 5 percent"); + Assert.All(drives, d => Assert.True(d.Axis > .5f, "premise: the drives are pushing")); + Assert.True(abs(heading) < .1f); } [Theory]