summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index da13a3b..eb82d0b 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7478,6 +7478,36 @@ test("Primary repetition builds one target plan from live matching policy", func
truthy(insensitive.target_plan:matches("A"))
end)
+test("Primary repetition builds its effective contextual motion plan", function()
+ local _, transitions = fresh_sequence_state()
+ local landing = domain.Position.new(1, 3)
+ transitions:BeginAcquisition("v", "t")
+ transitions:CommitAcquiredTarget("v", target("a"))
+ transitions:CommitVisualSuccess("v", landing)
+ local host = MemoryHost.new({
+ buffer_lines = { "ababa" },
+ cursor = landing,
+ mode = "v",
+ selection = domain.Selection.active(
+ domain.SelectionKind.CHARACTER,
+ domain.Position.new(1, 1),
+ landing,
+ domain.SelectionOption.EXCLUSIVE
+ ),
+ })
+
+ local resolution = sequence_coordinator.new({ host = host }):primary("F")
+
+ same(resolution.target_plan, resolution.motion_plan.target_plan)
+ same(domain.Descriptor.TILL_BACKWARD, resolution.effective_descriptor)
+ same(resolution.effective_descriptor, resolution.motion_plan.descriptor)
+ same(domain.SearchScope.BUFFER, resolution.motion_plan.search_scope)
+ same(
+ domain.EndpointPolicy.VISUAL_EXCLUSIVE,
+ resolution.motion_plan.endpoint_policy
+ )
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then