diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 15 |
1 files changed, 15 insertions, 0 deletions
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 |
