summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 1c07824..5dfe425 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -3606,6 +3606,39 @@ test("Operator execution preserves FIND and TILL endpoint conventions", function
end
end)
+test("Operator success creates a resolved dot payload", function()
+ fresh_sequence_state()
+ local target_value = target("e")
+ local host = MemoryHost.new({
+ buffer_lines = { "hoge fuge piye poye" },
+ cursor = { line = 1, byte_column = 1 },
+ mode = "no",
+ pending_operator = "delete",
+ })
+ local plan = motion_plan.build(
+ target_plan.build(target_value, matching_policy()),
+ "f"
+ )
+ local direct_payload = motion_executor.create_dot_payload(plan)
+ same(domain.Descriptor.FIND_FORWARD, direct_payload.descriptor)
+ same(target_value, direct_payload.target)
+
+ local outcome = motion_executor.new(host):execute(
+ text_topology.from_host(host),
+ "no",
+ plan,
+ 1,
+ true
+ )
+ same(domain.ActionKind.MOVEMENT, outcome.kind)
+ same(domain.Position.new(1, 1), outcome.position)
+ same(domain.Position.new(1, 4), outcome.search_outcome.endpoint)
+ truthy(domain.DotPayload.is(outcome.dot_payload))
+ same(domain.Descriptor.FIND_FORWARD, outcome.dot_payload.descriptor)
+ same(target_value, outcome.dot_payload.target)
+ same(outcome.dot_payload, host:dot_repeat_payload())
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then