Tests that press a trigger once release it: a held trigger keeps firing now

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-23 01:57:43 +02:00
commit 43042177d6
4 changed files with 7 additions and 0 deletions

View file

@ -354,6 +354,7 @@ public sealed partial class ContactRevealTests : IDisposable
capacitor.AddCharge(1000f);
ship.SetTarget(TargetRef.None);
gun.Activate();
gun.Deactivate();
for (var i = 0; i < 10; i++)
{
Tick(.1f);
@ -1277,6 +1278,7 @@ public sealed partial class ContactRevealTests : IDisposable
((InputCapacitor) typeof(InstantWeapon).GetField("_capacitor", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(killerGun)).AddCharge(1000f);
killer.SetTarget(TargetRef.None);
killerGun.Activate();
killerGun.Deactivate();
for (var ticks = 0; !killed && ticks < 20; ticks++) Tick(.1f);
Assert.True(killed, "fixture: the kill lands inside a tick");
Assert.False(_zone.Entities.Contains(e), "fixture: the kill took the subject out of the zone");

View file

@ -1052,6 +1052,7 @@ public sealed class FireControlPerWeaponTests : IDisposable
var weapon = (InstantWeapon) r.Gun.Weapon;
r.Zone.Update(.25f);
weapon.Activate();
weapon.Deactivate();
r.Zone.Update(.25f);
Assert.False(weapon.CanFire, "control: the first burst fired and is cooling");
for (var i = 0; i < 10 && !weapon.CanFire; i++) r.Zone.Update(.25f);

View file

@ -168,6 +168,7 @@ public sealed class MineTests : IDisposable
{
var before = lab.Zone.Mines.Count;
lab.Weapon.Activate();
lab.Weapon.Deactivate();
lab.Zone.Update(dt);
Assert.Equal(before + 1, lab.Zone.Mines.Count);
return lab.Zone.Mines.Last();
@ -532,6 +533,7 @@ public sealed class MineTests : IDisposable
foreach (var lab in new[] { a, b })
{
lab.Weapon.Activate();
lab.Weapon.Deactivate();
lab.Zone.Update(.1f);
lab.Zone.Update(.1f);
}
@ -803,6 +805,7 @@ public sealed class MineTests : IDisposable
lab.Zone.Log = log.Add;
lab.Weapon.Activate();
lab.Weapon.Deactivate();
lab.Zone.Update(.1f);
Assert.Empty(lab.Zone.Mines);

View file

@ -172,6 +172,7 @@ public sealed class SignatureTests : IDisposable
}
r.Ship.SetTarget(TargetRef.None);
r.Weapon.Activate();
r.Weapon.Deactivate();
for (var i = 0; i < 5; i++) r.Zone.Update(.1f);
}