diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-03 17:45:10 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-03 17:47:54 -0300 |
| commit | 00629bd791b8e41204366a795b6f36a289a45a68 (patch) | |
| tree | fd3bb018a8ff8591cc55eb111057716de6e44f62 /test/behaviour/look_and_exec.zig | |
| parent | 8fe05231e6e683b09b89356d4dff0ddb487962e4 (diff) | |
| download | pardes-00629bd791b8e41204366a795b6f36a289a45a68.tar.gz pardes-00629bd791b8e41204366a795b6f36a289a45a68.zip | |
test: two checks the panes migration dropped though the 9P tree shows them, from a review: a look leaves select mode and the extra cursors behind (mode:normal on the pane's ctl after Cv and a look, a Z typed once), as the old test's cleared() asked of select and nsel; a click past a line's end and on a wide glyph's second cell draws the caret where it lands, and insert mode draws it there too (Session.cursor from /screen), as the old tests compared the render's cursor; each checked to fail against a break (clearNavigationSelection keeping select, keeping nsel; the insert-mode body caret drawn a cell right)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
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"); |
