diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:12:50 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:12:50 +0200 |
| commit | e5a01335f0d6fe7167e3e615c7244b56e96d8599 (patch) | |
| tree | 3643d51fd302ca8c03cfd61ba49572b3f8188b90 /tests/run.lua | |
| parent | 0455756954fff259e735ddda970df6a89b9b2f76 (diff) | |
Build opposite-direction requests
Diffstat (limited to 'tests/run.lua')
| -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 |
