From 293747c5f97e7f6f05e2d593dbd352717fcb2049 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 07:57:32 +0200 Subject: [PATCH] ConsumableSupplyTests: pin the generator's Random after generation to the pre-consumable tree The gated-versus-plain comparison alone cannot see an unconditional draw (both catalogs draw). Values measured on origin/master d4a27def with the same fixture. The roll-before-availability mutant survived the full suite without this pin. Co-Authored-By: Claude Opus 5.5 --- .../Aetheria.Shared.Tests/ConsumableSupplyTests.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ConsumableSupplyTests.cs b/tests/Aetheria.Shared.Tests/ConsumableSupplyTests.cs index 5642da55c..7d3325df5 100644 --- a/tests/Aetheria.Shared.Tests/ConsumableSupplyTests.cs +++ b/tests/Aetheria.Shared.Tests/ConsumableSupplyTests.cs @@ -230,8 +230,16 @@ public sealed class ConsumableSupplyTests : IDisposable .Concat(Enumerable.Range(0, 4).Select(_ => rig.Items.Random.NextFloat())).ToArray(); } - var baseline = AfterGeneration(plain); - Assert.Equal(baseline, AfterGeneration(gated)); - Assert.NotEqual(baseline, AfterGeneration(control)); + // What the plain catalog leaves in both generators' Random, measured on the tree before consumables existed + // (origin/master d4a27def, the same fixture and seeds). The gated and plain catalogs agreeing is not enough: + // a step that drew unconditionally would draw in both. This pins the value itself. + var beforeConsumables = new[] + { + 0.85624266f, 0.037778974f, 0.7931649f, 0.3596493f, 0.17511952f, 0.6642336f, 0.31897342f, 0.5977364f + }; + var plainAfter = AfterGeneration(plain); + Assert.Equal(beforeConsumables, plainAfter); + Assert.Equal(plainAfter, AfterGeneration(gated)); + Assert.NotEqual(plainAfter, AfterGeneration(control)); } }