Tests: a consumable listener's Multiple below 1 is not clamped up

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-13 21:57:12 +02:00
commit 2cd92fe15d
2 changed files with 15 additions and 0 deletions

View file

@ -64,6 +64,7 @@ public sealed partial class ContactRevealTests : IDisposable
cache.Upsert(Listener("Wide", 5f));
cache.Upsert(Listener("Narrow", 1.5f));
cache.Upsert(Listener("Hush", .5f));
cache.Upsert(new ConsumableItemData { Name = "HushEarpiece", Duration = 30f, Shape = new Shape(), Behaviors = { new ListenerData { Multiple = Const(.5f) } } });
cache.Upsert(new ConsumableItemData { Name = "WideEarpiece", Duration = 30f, Shape = new Shape(), Behaviors = { new ListenerData { Multiple = Const(5f) } } });
cache.Upsert(new ConsumableItemData { Name = "NarrowEarpiece", Duration = 30f, Shape = new Shape(), Behaviors = { new ListenerData { Multiple = Const(1.5f) } } });
cache.Upsert(Tool("Reactor", new ReactorData { Charge = Const(1000), Efficiency = Const(1), OverloadEfficiency = Const(1), ThrottlingFactor = Const(2) }));

View file

@ -177,6 +177,20 @@ public sealed partial class ContactRevealTests
Assert.Equal(heard ? 1 : 0, ear.RevealsOf(p).Count());
}
[Theory]
[InlineData(149f, true)]
[InlineData(151f, false)]
public void AConsumableMultipleBelowOneIsNotClampedUp(float distance, bool heard)
{
var p = Add(float3(0, 0, 0), new[] { "Eye" });
var ear = Add(float3(distance, 0, 0));
Activate(ear, "HushEarpiece");
PingAt(p);
Assert.Equal(heard ? 1 : 0, ear.RevealsOf(p).Count());
}
// ---- ListenerDataRoundTripsAsUnionKey50 ----
[Fact]