summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index dd0da6f..2b1613c 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -3245,6 +3245,30 @@ test("Complete command direction compares destination with saved origin", functi
falsy(motion_executor.moved_forward(origin, origin))
end)
+test("A stationary first TILL completion is not forward movement", function()
+ local origin = domain.Position.new(1, 1)
+ falsy(motion_executor.command_moved_forward("t", origin, origin))
+
+ local host = MemoryHost.new({
+ buffer_lines = { "ab" },
+ cursor = origin,
+ })
+ local plan = motion_plan.build(
+ target_plan.build(target("b"), matching_policy()),
+ "t"
+ )
+ local outcome = motion_executor.new(host):execute(
+ text_topology.from_host(host),
+ "n",
+ plan,
+ 1,
+ true
+ )
+ same(domain.ActionKind.MOVEMENT, outcome.kind)
+ same(origin, outcome.position)
+ same(1, outcome.successful_steps)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then