SimRateTests: a zero cooldown ends its step

This commit is contained in:
soul 2026-10-23 00:50:18 +02:00
commit 99f5820565

View file

@ -332,13 +332,13 @@ public sealed partial class ContactRevealTests
Assert.True(pairs > 100, $"{pairs} pairs of rounds in one step");
}
// A cooldown of nothing is a gun as fast as the shortest cycle, not a step that never ends.
// A cooldown of nothing is a gun bounded by the shortest cycle (and by what its power can pay), not a step that never ends.
[Fact]
public void AGunWithNoCooldownFiresAtTheShortestCycle()
public void AGunWithNoCooldownStillEndsItsStep()
{
var ship = Add(float3(0, 0, 0), new[] { GunWithCooldown(0f) }, new[] { "Targeting", "Reactor" });
var rounds = HoldTrigger(ship, Guns(ship)[0], 1f / 30f, 1f);
Assert.True(abs(rounds.Count - 2000f) <= 1.01f, $"{rounds.Count} rounds in 1 s, expected 2000 +-1");
Assert.InRange(rounds.Count, 1, 2001);
}
// The cluster's cost: a point-defence battery of 0.005 s guns holding its trigger, every round a queued shot with its own