diff --git a/tests/Aetheria.Shared.Tests/ContactRevealTests.cs b/tests/Aetheria.Shared.Tests/ContactRevealTests.cs index c5b3ced75..acf064dfc 100644 --- a/tests/Aetheria.Shared.Tests/ContactRevealTests.cs +++ b/tests/Aetheria.Shared.Tests/ContactRevealTests.cs @@ -1517,11 +1517,13 @@ public sealed partial class ContactRevealTests : IDisposable Assert.True(lapsed, "fixture: the bearing lapsed"); } - // The memory window is exclusive: at Zone.Time - freshest == BearingMemory the bearing has lapsed, and for a subject that - // has departed the book drops it (and the stance with it) on that tick. The sighting is on a coarse float time (.5) so + // The memory window is exclusive: at Zone.Time - freshest == BearingMemory the bearing has lapsed (Detected, whether the + // subject stays or departs), and a departed subject's book entry (and the stance with it) goes on that tick. The sighting is on a coarse float time (.5) so // that freshest + memory is representable and a step can land on it exactly. - [Fact] - public void TheMemoryWindowIsExclusiveAtTheEquality() + [Theory] + [InlineData(false)] + [InlineData(true)] + public void TheMemoryWindowIsExclusiveAtTheEquality(bool departs) { var e = Add(float3(0, 0, 100), new[] { "Gun" }); var o = Add(float3(0, 0, 0), new[] { "Eye" }); @@ -1533,7 +1535,7 @@ public sealed partial class ContactRevealTests : IDisposable Assert.Equal(.5f, freshest); ShowOnly(e, 1f, gun); Assert.True(e.Visibility * o.PassiveInfo(e.Position.xz, 1f) <= _items.GameplaySettings.TargetDetectionInfoThreshold, "fixture: unseen"); - _zone.Remove(e); + if (departs) _zone.Remove(e); var memory = _items.GameplaySettings.BearingMemory; for (var i = 0; i < 1000 && _zone.Time - freshest + .3f < memory; i++) Tick(.1f); Assert.True(o.RememberedHostiles.Contains(e), "fixture: still listed"); @@ -1552,8 +1554,11 @@ public sealed partial class ContactRevealTests : IDisposable Assert.Equal(memory, _zone.Time - freshest); Assert.False(o.RememberedHostiles.Contains(e)); Assert.False(o.ContactOf(e).Detected); - Assert.DoesNotContain(e, o.RevealedSubjects); - Assert.False(o.IsHostileTo(e), "the book dropped the departed subject at the edge, and the stance with it"); + if (departs) + { + Assert.DoesNotContain(e, o.RevealedSubjects); + Assert.False(o.IsHostileTo(e), "the book dropped the departed subject at the edge, and the stance with it"); + } } // A stance lasts the sitting: a hostile still in the zone whose every revealed item the observer perceives destroyed