From e5a01335f0d6fe7167e3e615c7244b56e96d8599 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:12:50 +0200 Subject: Build opposite-direction requests --- tests/run.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index f60dbc6..4b6f1c7 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4111,6 +4111,21 @@ test("Explicit same-direction requests use the stored descriptor", function() end, "immutable") end) +test("Explicit opposite-direction requests swap the stored descriptor", function() + local _, transitions = fresh_sequence_state() + local stored_target = target("x") + local resolver = repeat_resolver.new() + + for _, stored in ipairs({ "f", "F", "t", "T" }) do + transitions:BeginAcquisition("n", stored) + transitions:CommitAcquiredTarget("n", stored_target) + local request = resolver:opposite_direction_request("n") + same(domain.Descriptor.swap(stored), request.descriptor) + same(stored_target, request.target) + falsy(request.neutral) + end +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3