Keep active-combat AutoWield intent through ACE's pre-wield transition and queued trailing peace notice, while allowing explicit combat input to supersede it. Queue one-shot item interactions until the frame's movement edge has been serialized, so a movement release cannot cancel ACE's server-side corpse approach callback. Release build succeeds and all 5,890 runnable tests pass with five intentional skips. Co-authored-by: OpenAI Codex <codex@openai.com>
56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using AcDream.App.Input;
|
|
|
|
namespace AcDream.App.Tests.Input;
|
|
|
|
public sealed class OutboundInteractionQueueTests
|
|
{
|
|
[Fact]
|
|
public void Drain_PreservesInputOrder()
|
|
{
|
|
var queue = new OutboundInteractionQueue();
|
|
var actual = new List<string>();
|
|
|
|
queue.Enqueue(() => actual.Add("use-corpse"));
|
|
queue.Enqueue(() => actual.Add("pickup-item"));
|
|
|
|
queue.Drain();
|
|
|
|
Assert.Equal(new[] { "use-corpse", "pickup-item" }, actual);
|
|
Assert.Equal(0, queue.Count);
|
|
}
|
|
|
|
[Fact]
|
|
public void Drain_ReentrantEnqueueWaitsForNextFrame()
|
|
{
|
|
var queue = new OutboundInteractionQueue();
|
|
var actual = new List<string>();
|
|
queue.Enqueue(() =>
|
|
{
|
|
actual.Add("first");
|
|
queue.Enqueue(() => actual.Add("next-frame"));
|
|
});
|
|
|
|
queue.Drain();
|
|
|
|
Assert.Equal(new[] { "first" }, actual);
|
|
Assert.Equal(1, queue.Count);
|
|
|
|
queue.Drain();
|
|
|
|
Assert.Equal(new[] { "first", "next-frame" }, actual);
|
|
Assert.Equal(0, queue.Count);
|
|
}
|
|
|
|
[Fact]
|
|
public void Clear_DropsPendingSessionActions()
|
|
{
|
|
var queue = new OutboundInteractionQueue();
|
|
bool invoked = false;
|
|
queue.Enqueue(() => invoked = true);
|
|
|
|
queue.Clear();
|
|
queue.Drain();
|
|
|
|
Assert.False(invoked);
|
|
}
|
|
}
|