summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:49:08 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:49:08 +0200
commit33e93f67e78d3a502401442f80ff2572ed35d5dd (patch)
tree99cf98f33fbc47f56269ac6ac8392d1393b683cf /tests
parent80206387c712c2ef78eb1ce6546aa3d3969d7bb8 (diff)
Compare command destinations
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 02f5e2d..dd0da6f 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -3231,6 +3231,20 @@ test("Incomplete command execution preserves successful history", function()
same(25, state.repeat_timestamp_ms)
end)
+test("Complete command direction compares destination with saved origin", function()
+ local origin = domain.Position.new(2, 3)
+ truthy(
+ motion_executor.moved_forward(origin, domain.Position.new(2, 4))
+ )
+ truthy(
+ motion_executor.moved_forward(origin, domain.Position.new(3, 1))
+ )
+ falsy(
+ motion_executor.moved_forward(origin, domain.Position.new(2, 2))
+ )
+ falsy(motion_executor.moved_forward(origin, origin))
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then