summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index d360332..11062ac 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4147,6 +4147,23 @@ test("Missing explicit descriptors return a neutral request", function()
truthy(resolver:opposite_direction_request("n").neutral)
end)
+test("Missing explicit targets use character code zero", function()
+ local _, transitions = fresh_sequence_state()
+ transitions:BeginAcquisition("n", "T")
+ local resolver = repeat_resolver.new()
+
+ local same_request = resolver:same_direction_request("n")
+ local opposite_request = resolver:opposite_direction_request("n")
+ for _, request in ipairs({ same_request, opposite_request }) do
+ falsy(request.neutral)
+ same(domain.TargetKind.CODE_FALLBACK, request.target.kind)
+ same(0, request.target.first_code)
+ same("", request.target.value)
+ end
+ same(domain.Descriptor.TILL_BACKWARD, same_request.descriptor)
+ same(domain.Descriptor.TILL_FORWARD, opposite_request.descriptor)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then