summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 11:13:31 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 11:13:31 +0200
commited9688ce68f0e6cded2e54e64057b58e040d26e4 (patch)
tree861a806db3867b4eca7eb71b7ce9991f9cc1f0f5 /tests
parente5a01335f0d6fe7167e3e615c7244b56e96d8599 (diff)
Handle missing explicit descriptors
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 4b6f1c7..d360332 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4126,6 +4126,27 @@ test("Explicit opposite-direction requests swap the stored descriptor", function
end
end)
+test("Missing explicit descriptors return a neutral request", function()
+ local _, transitions = fresh_sequence_state()
+ local resolver = repeat_resolver.new()
+ local same_request = resolver:same_direction_request("n")
+ local opposite_request = resolver:opposite_direction_request("n")
+
+ same(same_request, opposite_request)
+ truthy(domain.ExplicitRepeatRequest.is(same_request))
+ truthy(same_request.neutral)
+ truthy(same_request:is_neutral())
+ same(nil, same_request.descriptor)
+ same(nil, same_request.target)
+ truthy(same_request:to_table().neutral)
+
+ transitions:BeginAcquisition("n", "f")
+ transitions:CommitAcquiredTarget("n", target("a"))
+ transitions:PublicReset()
+ truthy(resolver:same_direction_request("n").neutral)
+ truthy(resolver:opposite_direction_request("n").neutral)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then