diff options
Diffstat (limited to 'test/behaviour/look_and_exec.zig')
| -rw-r--r-- | test/behaviour/look_and_exec.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/behaviour/look_and_exec.zig b/test/behaviour/look_and_exec.zig index ec26b74f..3c76988e 100644 --- a/test/behaviour/look_and_exec.zig +++ b/test/behaviour/look_and_exec.zig @@ -43,9 +43,20 @@ test "look-and-exec: a look replaces the selection it was made from, for an addr const n = try s.focused(); const dot = s.at("/pane/{d}/dot", .{n}); const look = s.at("/pane/{d}/look", .{n}); + const ctl = s.at("/pane/{d}/ctl", .{n}); + const body = s.at("/pane/{d}/body", .{n}); try s.write(dot, "0 5"); + // A second cursor on the line below, and select mode. + try s.keys("Cv"); + try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:select ")); try s.write(look, "/test.txt:3:2\n"); try expectEqual(.{ @as(u32, 13), @as(u32, 13) }, try s.range(dot)); + // Both are gone with it: normal mode, and what is typed goes in once. + try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:normal ")); + try s.keys("iZ\x1b"); + try s.expect(body, "alpha\nbravo\ncZharlie\nneedle\n"); + try s.write(ctl, "Undo\n"); + try s.expect(body, "alpha\nbravo\ncharlie\nneedle\n"); try s.write(dot, "0 5"); try s.write(look, "/test.txt:2:2-4\n"); try s.expect(s.at("/pane/{d}/sel", .{n}), "rav"); |
