summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 14:21:14 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 14:21:14 +0200
commit5199ca2e6527ce83b80898c57a09e984beb1fb67 (patch)
tree02b8fde9b465c02e24a14db372c64c457bd151fe /tests
parentf44fed2bbf772b63861077dc25b591faa0e39cd7 (diff)
Configure count-preserving mappings
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index d30aea4..87b6e73 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7219,6 +7219,9 @@ test("Core activation installs four default mappings in required modes", functio
same(expected.lhs, actual.lhs)
same(expected.action, actual.action)
list_same(composition_root.DEFAULT_MAPPING_MODES, actual.modes)
+ truthy(actual.options.silent)
+ falsy(actual.options.remap)
+ truthy(actual.options.preserve_count)
end
fresh_sequence_state()
@@ -7230,6 +7233,30 @@ test("Core activation installs four default mappings in required modes", functio
same(0, map_size(suppressed_host:mappings()))
end)
+test("Default mappings are silent non-recursive and count-preserving", function()
+ fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer_lines = { "ababa" },
+ cursor = { line = 1, byte_column = 1 },
+ count = 2,
+ input_packets = { { kind = "text", text = "a" } },
+ configuration = {
+ mark_cursor = false,
+ mark_char = false,
+ },
+ emit_movement_events = false,
+ })
+ local activation = composition_root.new({ host = host }):activate()
+ local mapping = host:mappings()[activation.mappings.f]
+
+ truthy(mapping.options.silent)
+ falsy(mapping.options.remap)
+ truthy(mapping.options.preserve_count)
+ local outcome = host:invoke_action(mapping.action)
+ same(2, outcome.successful_steps)
+ same(domain.Position.new(1, 5), outcome.position)
+end)
+
test("Primary coordination accepts only the four motion descriptors", function()
local coordinator = sequence_coordinator.new({ host = MemoryHost.new() })
for _, value in ipairs({ "f", "F", "t", "T" }) do