From 33e93f67e78d3a502401442f80ff2572ed35d5dd Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:49:08 +0200 Subject: Compare command destinations --- tests/run.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3