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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 07:57:32 +02:00
commit 293747c5f9

View file

@ -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));
}
}