summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/run.lua43
1 files changed, 42 insertions, 1 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 2d38574..728024e 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7885,6 +7885,47 @@ test("Coordinated operator changes record resolved dot payload", function()
same(" fuge", host:read_text():line(1))
end)
+test("Coordinated dot payload replays directly without target input", function()
+ fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer_lines = { "hoge fuge piye poye" },
+ cursor = { line = 1, byte_column = 1 },
+ mode = "no",
+ pending_operator = "delete",
+ input_packets = { { kind = "text", text = "e" } },
+ configuration = {
+ mark_cursor = false,
+ mark_char = false,
+ },
+ emit_movement_events = false,
+ })
+ local facade = action_facade.new({ host = host })
+
+ local first = facade:primary("f")
+ same(domain.ActionKind.MOVEMENT, first.kind)
+ local expected = {
+ " fuge piye poye",
+ " piye poye",
+ " poye",
+ "",
+ }
+ same(expected[1], host:read_text():line(1))
+ for index = 2, #expected do
+ local replay = host:replay_dot(1)
+ same(domain.ActionKind.MOVEMENT, replay.kind)
+ same(first.dot_payload, replay.dot_payload)
+ same(expected[index], host:read_text():line(1))
+ end
+
+ local input_reads = 0
+ for _, operation in ipairs(host:operations()) do
+ if operation.operation == "read_input" then
+ input_reads = input_reads + 1
+ end
+ end
+ same(1, input_reads)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then
@@ -7894,4 +7935,4 @@ for _, item in ipairs(tests) do
passed = passed + 1
end
-io.stdout:write(string.format("Phase 13: %d tests passed\n", passed))
+io.stdout:write(string.format("Phase 14: %d tests passed\n", passed))