From 587d19f525331a770d424ef570a20f638e76aa26 Mon Sep 17 00:00:00 2001 From: soul Date: Fri, 27 Nov 2026 07:33:18 +0100 Subject: [PATCH] EconomyLoopTests: a sortie is a function of its seed (follow-up sortie-determinism-pin) Co-Authored-By: Claude Sonnet 5.5 --- .../Aetheria.Shared.Tests/EconomyLoopTests.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/EconomyLoopTests.cs b/tests/Aetheria.Shared.Tests/EconomyLoopTests.cs index 3af46fdd3..d093f1e5e 100644 --- a/tests/Aetheria.Shared.Tests/EconomyLoopTests.cs +++ b/tests/Aetheria.Shared.Tests/EconomyLoopTests.cs @@ -195,6 +195,25 @@ public sealed class EconomyLoopTests Assert.Equal(before, System.Security.Cryptography.SHA256.HashData(File.ReadAllBytes(catalog))); } + // Follow-up sortie-determinism-pin: a seed fixes the sortie. Each call generates its own run store, so the keys the cache + // mints differ between the two; ore, target order and rock meshes must not read them (zone-body-sites). + [Fact] + public void ASortieIsAFunctionOfItsSeed() + { + var first = EconomyLoop.Sortie(Root, 1, 0, 60); + var second = EconomyLoop.Sortie(Root, 1, 0, 60); + Assert.Equal(first.BeltKind, second.BeltKind); + Assert.Equal(first.Weapons, second.Weapons); + Assert.Equal(first.Outcome, second.Outcome); + Assert.Equal(first.Rocks, second.Rocks); + Assert.Equal(first.Units, second.Units); + Assert.Equal(first.HoldFullAt, second.HoldFullAt); + Assert.Equal(first.SellValue, second.SellValue); + Assert.Equal(first.AmmoSpent, second.AmmoSpent); + Assert.Equal(first.Repair, second.Repair); + Assert.Equal(first.SimSeconds, second.SimSeconds); + } + [Fact] public void AFullHoldSortieIsPricedFromTheShipItEndedWith() {