summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:40:42 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:40:42 +0200
commit69000b4e6acf9ecad0d3d9220bca6c1433993d6c (patch)
tree43cd427ae737ffc9a019fd4fc4e19d5e85328030 /tests
parentb42a765970010028637a46b2be340cf8a3507195 (diff)
Preserve finalized sequence data
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index cc2393f..b0f9cee 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -6346,6 +6346,34 @@ test("Full feedback finalization clears every landing and direction", function()
truthy(state.moved_forward_initialized)
end)
+test("Full feedback finalization preserves reusable sequence data", function()
+ local state, transitions = fresh_sequence_state()
+ local normal_target = target("a")
+ local visual_target = target("b")
+ local dictionary = { name = "cached-migemo" }
+ transitions:BeginAcquisition("n", "f")
+ transitions:CommitAcquiredTarget("n", normal_target)
+ transitions:BeginAcquisition("v", "T")
+ transitions:CommitAcquiredTarget("v", visual_target)
+ transitions:CommitVisualSuccess("v", domain.Position.new(2, 2))
+ transitions:CacheMigemo("utf-8", dictionary)
+ local input_context = state.last_input_context
+
+ feedback_service.new({
+ host = MemoryHost.new(),
+ transitions = transitions,
+ }):full_finalize("window-1")
+
+ same(domain.Descriptor.FIND_FORWARD, state:get_previous_descriptor("n"))
+ same(domain.Descriptor.TILL_BACKWARD, state:get_previous_descriptor("v"))
+ same(normal_target, state:get_previous_target("n"))
+ same(visual_target, state:get_previous_target("v"))
+ truthy(state:get_first_move("n"))
+ falsy(state:get_first_move("v"))
+ same(input_context, state.last_input_context)
+ same(dictionary, state:get_migemo("utf-8"))
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then