diff options
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 21 |
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 |
