diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 27 |
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 |
