summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:46:52 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:46:52 +0200
commit6c3009c5041a2e661504825f68b0a3675562a647 (patch)
tree2445344bab99a9bebd2978c023ff293350c1b87a /tests/run.lua
parent5913866a0e2918a1cab8700d79f2f0dbf5832cd1 (diff)
Build stored-motion restoration plan
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 9793411..d66e2c5 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -6756,6 +6756,41 @@ test("Primary restoration samples marker and context eligibility", function()
truthy(feedback:primary_restoration_active("s", "window-1"))
end)
+test("Primary restoration combines action target with stored motion policy", function()
+ fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer_lines = { "aA" },
+ configuration = { mark_char = true },
+ })
+ local feedback = feedback_service.new(host)
+ local action_target = target_plan.build(target("a"), {
+ ignore_case = true,
+ smart_case = false,
+ use_migemo = false,
+ chars_match_any_signs = "",
+ })
+ local action_motion = motion_plan.build(action_target, "f")
+ local restoration = feedback:build_primary_restoration({
+ context = "v",
+ anchor = domain.Position.new(1, 1),
+ target_plan = action_target,
+ motion_plan = action_motion,
+ stored_descriptor = "T",
+ endpoint_policy = domain.EndpointPolicy.VISUAL_EXCLUSIVE,
+ window = "window-1",
+ })
+
+ same(action_target, restoration.target_plan)
+ same(action_target, restoration.motion_plan.target_plan)
+ same(domain.Descriptor.TILL_BACKWARD, restoration.descriptor)
+ same(domain.Descriptor.TILL_BACKWARD, restoration.motion_plan.descriptor)
+ same(domain.EndpointPolicy.VISUAL_EXCLUSIVE, restoration.endpoint_policy)
+ same(
+ domain.EndpointPolicy.VISUAL_EXCLUSIVE,
+ restoration.motion_plan.endpoint_policy
+ )
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then