diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 23:42:03 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 00:26:22 -0300 |
| commit | 57a696106fb628aa39aa3c082234865c199fd483 (patch) | |
| tree | 8496cba3ec8cb01a2f2cc51f50c8679670ad7f38 /test/behaviour | |
| parent | 2f3ba8edfa26eb9dad190da42ab6a1ac4f29ffd8 (diff) | |
| download | pardes-57a696106fb628aa39aa3c082234865c199fd483.tar.gz pardes-57a696106fb628aa39aa3c082234865c199fd483.zip | |
config, look, Trail, tests: jumps walk by default, `Jumps new-pane` the opt-out (walk UI G item 3, the coordinator's ruling: SPEC §6.6), every test about a jump opening a pane set to new-pane, a reader placed with its walk in its tag and a stepped pane lifted to its tag's rows: config.zig Settings.jumps is `.walk`; FOUND BY THE FLIP (core/ninep/tree.zig 'random placements, refused or not, leave no pane under its tag and two rows', seed 69 rows 21: a Look's reader 5 rows high where its tag takes 2): look.zig walk set a new reader's walk (‹@pN and its place) after openNew had placed it, so its rows were given for a tag a row shorter; openNew sets it before layout.placeNew now; Trail.show (a step to another file in place, Back, Forward, a list's n) replaced the pane with its trail and a longer name and gave it the old pane's rows, and a step in the same file pushed a word the tag may wrap on: Trail.lift gives the stepped pane its minimum from its column (layout.restoreMinimaFrom, the others keeping theirs); NOT FIXED (seed 109): a step in place in a column with no rows to give still wraps its tag under its minimum (the spec's give-way, folding the trail further, is the fix): that test runs with new-pane now (it is about placements as a Look made them), its comment says so; core/replica.zig's may_wait gets `Look *` stopping at read_file: a jump from a held pane (a kind's, a listing's) opens its reader from the disk where new-pane focused the reading pane already showing the file (SPEC §6.1 focuses a held one only); TESTS SET TO `Jumps new-pane` (each ABOUT a Look opening a pane, a query pane, a twin, Back/Forward over panes, a placement): 39 core and pane tests (look.zig 10, Query.zig 7, jj.zig 7, edit_cmd.zig 3, ninep/ctl.zig 2, test/panes.zig 3, lsp/Ask, Messages (C's SPC e +Search way), Store, layout, rollback, replica, ninep/tree), 25 behaviour tests (look-and-exec 5, placement 4, other-files 5, modes 3, language-servers 3, settings, follow, addons, columns-and-tags, panes), 18 process cases (`.init` or Tty.config: edit, flags 2, the canary, mounts, other-files 2, root-ctl, tree 2, filewatch, topbarexec, chordcut, cmdword, grep, lsprelpath, lsp-rename-files, layout-open); TESTS OF A FILE PANE'S TAG made to hold their pane first (`Keep`, SPEC §6.5: the `Keep` word moves every offset after the path): 16 behaviour tests (tags 11, keys 2, panes, columns-and-tags); GOLDENS regenerated and read, each changed row only ` Keep` after a reading pane's path (.scratch/walkui/G/gkeep.py): argv builtins cmdexit collapse delask lsp-rename lspcomplete markup mini msg nested-optout pipe savepane selregex themesel tutor (16); the other 41 changed goldens are NOT in this change (their rows move with more than the word: see the next change); tui core-test 1037/1206 (169 skipped), shell-test 1253/1256, pane-test 183/184 (1 skipped), behaviour-test 277/277, process-test 41 of 146 failed (those 41 goldens, every one a GoldenMismatch)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/behaviour')
| -rw-r--r-- | test/behaviour/addons.zig | 2 | ||||
| -rw-r--r-- | test/behaviour/columns_and_tags.zig | 4 | ||||
| -rw-r--r-- | test/behaviour/follow.zig | 2 | ||||
| -rw-r--r-- | test/behaviour/keys.zig | 4 | ||||
| -rw-r--r-- | test/behaviour/language_servers.zig | 6 | ||||
| -rw-r--r-- | test/behaviour/look_and_exec.zig | 10 | ||||
| -rw-r--r-- | test/behaviour/modes.zig | 6 | ||||
| -rw-r--r-- | test/behaviour/other_files.zig | 10 | ||||
| -rw-r--r-- | test/behaviour/panes.zig | 4 | ||||
| -rw-r--r-- | test/behaviour/placement.zig | 8 | ||||
| -rw-r--r-- | test/behaviour/settings.zig | 2 | ||||
| -rw-r--r-- | test/behaviour/tags.zig | 22 |
12 files changed, 80 insertions, 0 deletions
diff --git a/test/behaviour/addons.zig b/test/behaviour/addons.zig index 8b54de02..ce3c7b02 100644 --- a/test/behaviour/addons.zig +++ b/test/behaviour/addons.zig @@ -188,6 +188,8 @@ test "addons: the image addon opens the pictures a Look names, fitted, with the test "addons: a plumbing rule to a loaded kind opens that kind's pane; to one not loaded, or with its kind gone, the look falls through to text" { var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); try load(&s, Session.image_addon); var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); diff --git a/test/behaviour/columns_and_tags.zig b/test/behaviour/columns_and_tags.zig index d5820610..9abe64f4 100644 --- a/test/behaviour/columns_and_tags.zig +++ b/test/behaviour/columns_and_tags.zig @@ -22,6 +22,8 @@ test "columns-and-tags: a look after Newcol fills the empty column the keyboard const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); // Newcol makes an empty column and gives its tag the keyboard; no pane // has it, so focus reads empty. try s.write("/ctl", "Newcol\n"); @@ -166,6 +168,8 @@ test "columns-and-tags: New is a column tag's word, in no pane's tag nor the wor test "columns-and-tags: a click past a column tag's text types after it, a newline typed there a space, and a long tag scrolls to its caret" { var s = try Session.initFile(std.testing.allocator, "body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const tag = s.at("/col/{d}/tag", .{try s.column(0)}); // Its row, then the pane's tag: the column's stays one row. const rows = " New Term Find Grep Joincol Delcol"; diff --git a/test/behaviour/follow.zig b/test/behaviour/follow.zig index 22c1c3d5..bf0141d2 100644 --- a/test/behaviour/follow.zig +++ b/test/behaviour/follow.zig @@ -172,6 +172,8 @@ test "follow: a collapsed page is passed over: the cursor past the page before i test "follow: Unfollow leaves a twin with its own scroll and closes the chain up; Del of the head makes the next one head" { var s = try init(); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const head = try s.focused(); try s.write(s.at("/pane/{d}/exec", .{head}), "Follow\n"); const second = try newest(&s); diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig index 8bf187f8..cfa76aa5 100644 --- a/test/behaviour/keys.zig +++ b/test/behaviour/keys.zig @@ -9,6 +9,8 @@ const window = "\x17"; // Ctrl-w test "keys: a prompt's entry and cancellation leave the tag, the body and its cursor as they were" { var s = try Session.initFile(std.testing.allocator, "one\ntwo\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); const tag = s.at("/pane/{d}/tag", .{n}); const dot = s.at("/pane/{d}/dot", .{n}); @@ -108,6 +110,8 @@ test "keys: a count or a prefix a click or a change of pane cancels leaves nothi errdefer std.debug.print("\nkeys={s} gesture={s}\n", .{ typed, @tagName(gesture) }); var s = try Session.initFile(std.testing.allocator, "abcdefghij\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); try s.write("/ctl", "Newcol\n"); const other = try s.newPane(); diff --git a/test/behaviour/language_servers.zig b/test/behaviour/language_servers.zig index ab9585ed..904fcfba 100644 --- a/test/behaviour/language_servers.zig +++ b/test/behaviour/language_servers.zig @@ -200,6 +200,8 @@ test "language-servers: Symbols lists the file's definitions by name, a local's defer tmp.cleanup(); var s = try Session.initLanguage(std.testing.allocator); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const main = try open(&s, &tmp, "4:13"); try s.write(s.at("/pane/{d}/look", .{main}), s.at("{s}/lib.rs\n", .{std.fs.path.dirname(std.mem.trimEnd(u8, try s.read(s.at("/pane/{d}/name", .{main})), "\n")).?})); try s.write(s.at("/pane/{d}/ctl", .{try s.focused()}), "Symbols\n"); @@ -230,6 +232,8 @@ test "language-servers: what the index does not know, and a pane with unsaved ch defer tmp.cleanup(); var s = try Session.initLanguage(std.testing.allocator); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); // `mod`, which no occurrence covers: the scripted server's answer, // lib.rs's second line. const main = try open(&s, &tmp, "1:1"); @@ -249,6 +253,8 @@ test "language-servers: what the index does not know, and a pane with unsaved ch test "language-servers: a real indexer's index answers too (rust-analyzer's, test/scipfixture), and Lspinfo says what it holds" { var s = try Session.initLanguage(std.testing.allocator); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const main = try s.lookFile("test/scipfixture/main.rs:5:13"); try s.write(s.at("/pane/{d}/ctl", .{main}), "Hover\n"); try std.testing.expectEqualStrings("pub fn add(a: i32, b: i32) -> i32\n\nAdds two numbers.\n", try bodyOf(&s, "+Hover")); diff --git a/test/behaviour/look_and_exec.zig b/test/behaviour/look_and_exec.zig index 1bc4f040..a7de93cd 100644 --- a/test/behaviour/look_and_exec.zig +++ b/test/behaviour/look_and_exec.zig @@ -448,6 +448,8 @@ test "look-and-exec: a look opens spaced paths and locations without editing the try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "two words.zig", .data = "first\nsecond\nthird\n" }); var s = try Session.initFile(std.testing.allocator, "source stays intact\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const path = s.at("{s}/two words.zig", .{try tmpPath(&s, &tmp)}); const source = try s.focused(); const ctl = try s.read(s.at("/pane/{d}/ctl", .{source})); @@ -478,6 +480,8 @@ test "look-and-exec: a look opens spaced paths and locations without editing the test "look-and-exec: a look validates the whole batch before opening virtual files" { var s = try Session.initFile(std.testing.allocator, "source\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const source = try s.focused(); const look = s.at("/pane/{d}/look", .{source}); const index = try s.read("/index"); @@ -596,6 +600,8 @@ test "look-and-exec: a look line's trailing colon is dropped, and a look whose a try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "a.txt", .data = "one\ntwo\nthree\n" }); var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); const before = lines(try s.read("/index")); // Failing addresses: nothing opened, the write still answered. @@ -617,6 +623,8 @@ test "look-and-exec: a look that misses file:/re/ names the file, and is logged try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "f.txt", .data = "alpha\n" }); var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); const first = try s.focused(); try s.write("/look", s.at("{s}/f.txt\n", .{dir})); @@ -631,6 +639,8 @@ test "look-and-exec: a look that goes to another pane leaves the looking pane's try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "f.txt", .data = "f one\nf two\n" }); var s = try Session.initFile(std.testing.allocator, "alpha bravo\ncharlie\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); const source = try s.focused(); const other = try s.newPane(); diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig index a50cfb0e..0f7c9d26 100644 --- a/test/behaviour/modes.zig +++ b/test/behaviour/modes.zig @@ -17,6 +17,8 @@ test "modes: Esc in normal mode alternates between two panes of the same kind" { const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "a\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const a = try s.focused(); try s.write("/look", s.at("{s}/b.txt\n", .{at})); const b = try s.focused(); @@ -133,6 +135,8 @@ fn outlined(s: *Session, lit: []const u8, names: []const []const u8) ![]const u8 test "modes: Ctrl-w outlines a pane, h j k l move the outline, and Enter, Esc, : or a pane's letter gives it the keyboard" { var s = try Session.initFile(std.testing.allocator, "left\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const a, const b, const c = try threePanes(&s); const names = &[_][]const u8{ "/a.txt", "/b.txt", "/c.txt" }; try s.keys("\x17"); @@ -176,6 +180,8 @@ fn listed(s: *Session, n: u32) !bool { test "modes: in window mode d deletes the outlined pane, asking k or j between two, c collapses it, and the mode stays on" { var s = try Session.initFile(std.testing.allocator, "top\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const top = try s.focused(); try s.write(s.at("/pane/{d}/exec", .{top}), "New\n"); const mid = try s.focused(); diff --git a/test/behaviour/other_files.zig b/test/behaviour/other_files.zig index bd8cbccd..b19ffa0f 100644 --- a/test/behaviour/other_files.zig +++ b/test/behaviour/other_files.zig @@ -124,6 +124,8 @@ test "other-files: a Jumplist entry is (closed) only while no pane has its file try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "b.txt", .data = "two\n" }); var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); try s.write("/look", s.at("{s}/a.txt\n", .{dir})); const a = try s.focused(); @@ -157,6 +159,8 @@ test "other-files: a closed file is found again: Recent and /recent list it clos try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "b.txt", .data = "bee\n" }); var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); const a = s.at("{s}/a.txt", .{dir}); // Opened, its dot on line 3, then closed. @@ -224,6 +228,8 @@ test "other-files: Back and Forward over a closed file's entries: one reopen is try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "c.txt", .data = "sea\n" }); var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); try s.write("/look", s.at("{s}/b.txt\n", .{dir})); const b = try s.focused(); @@ -285,6 +291,8 @@ test "other-files: Back over a closed file deleted since skips it, says so, and for ([_][]const u8{ "a.txt", "gone.txt", "c.txt" }) |name| try tmp.dir.writeFile(std.testing.io, .{ .sub_path = name, .data = "text\n" }); var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); try s.write("/look", s.at("{s}/a.txt\n", .{dir})); const a = try s.focused(); @@ -306,6 +314,8 @@ test "other-files: a remembered place is clamped to the file as it is now, its s try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "c.txt", .data = "one\ntwo\nthree\nfour\nfive\n" }); var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const dir = try tmpPath(&s, &tmp); try s.write("/look", s.at("{s}/c.txt:2\n", .{dir})); const c = try s.focused(); diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig index 4d4c812c..96bae187 100644 --- a/test/behaviour/panes.zig +++ b/test/behaviour/panes.zig @@ -170,6 +170,8 @@ test "panes: a second lock is refused until the holder unlocks or closes, and bi test "panes: an unsaved file's tag is its name alone, its dirty file says it is unsaved" { var s = try Session.initFile(std.testing.allocator, "before\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); const tag = s.at("/pane/{d}/tag", .{n}); const clean = try s.read(tag); @@ -265,6 +267,8 @@ test "panes: a pane its whole text fits in never scrolls to keep a margin" { const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "one\ntwo\nthree\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const n = try s.focused(); // A second pane under it, as acme's placement puts one: right under the // three lines, which leaves the file exactly three body rows. diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig index 05f730d1..467afd1b 100644 --- a/test/behaviour/placement.zig +++ b/test/behaviour/placement.zig @@ -10,6 +10,8 @@ test "placement: an empty active column takes the new pane whole, a look from an const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const first = try s.focused(); // Its tag has the keyboard: it is the active column, and stays so // when Esc gives the keyboard back. @@ -31,6 +33,8 @@ fn tagRow(s: *Session, name: []const u8) !usize { test "placement: New and 9P's new take the bottom half of the column's last pane" { var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const first = try s.focused(); try s.write(s.at("/pane/{d}/exec", .{first}), "New\n"); const last = try s.focused(); @@ -83,6 +87,8 @@ test "placement: a look from a pane's text goes under its text when it has many const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "one\ntwo\nthree\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); s.detach(); // Wide enough that a tag with the test's temporary path stays one row, // wherever the checkout is. @@ -117,6 +123,8 @@ test "placement: a look from the middle of a column splits only the pane it came const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "one\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); s.detach(); try s.write("/ctl", "size 100 60\n"); const top = try s.focused(); diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index a6e09f35..731d4c45 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -132,6 +132,8 @@ test "settings: Back and Forward written to exec keep to the focused file" { const dir = buf[0..try tmp.dir.realPath(std.testing.io, &buf)]; var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); // Each a look, as a user's jumps are: b1 a1 b40 a40 b80 a80. for ([_][]const u8{ "b.txt:1", "a.txt:1", "b.txt:40", "a.txt:40", "b.txt:80", "a.txt:80" }) |place| try s.write("/look", s.at("{s}/{s}\n", .{ dir, place })); const Step = struct { []const u8, []const u8, u32 }; diff --git a/test/behaviour/tags.zig b/test/behaviour/tags.zig index 30895ad8..e4e4c04b 100644 --- a/test/behaviour/tags.zig +++ b/test/behaviour/tags.zig @@ -22,6 +22,8 @@ fn tagCol(s: *Session, path: []const u8) !usize { test "tags: s and S in a tag answer for the tag's own text; / still searches the body" { var s = try Session.initFile(std.testing.allocator, "Some body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); try s.replace(s.at("/pane/{d}/tag", .{n}), " Save Del Snarf"); // The tag's line, its S's selected, then changed: both are the tag's. @@ -37,6 +39,8 @@ test "tags: s and S in a tag answer for the tag's own text; / still searches the test "tags: ms and md edit a tag's own text, and the text the edit made is read back whole" { var s = try Session.initFile(std.testing.allocator, "body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); try s.keys(":miwms("); try std.testing.expectEqualStrings("/test.txt (Save) Term Collapse Follow Del", try tag(&s, n)); @@ -47,6 +51,8 @@ test "tags: ms and md edit a tag's own text, and the text the edit made is read test "tags: the keyboard reaches a tag's path, which it can select and yank but not edit" { var s = try Session.initFile(std.testing.allocator, "body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); const before = try tag(&s, n); // `0` is the line's start, as in acme, where the name is ordinary text. @@ -73,6 +79,8 @@ test "tags: the keyboard reaches a tag's path, which it can select and yank but test "tags: a tag remembers its cursor, starts on Save, and a click moves it" { var s = try Session.initFile(std.testing.allocator, "body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const first = try s.focused(); try s.write("/ctl", "Newcol\n"); const second = try s.newPane(); @@ -133,6 +141,8 @@ test "tags: executing a word from the tag runs it and gives the keyboard back to test "tags: a renamed path moves the tag's cursor with the text after it and a shorter tag pulls it back" { var s = try Session.initFile(std.testing.allocator, "body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); try s.keys("::"); // on Save, and back try s.write(s.at("/pane/{d}/name", .{n}), "/界.zig"); @@ -166,6 +176,8 @@ test "tags: window keys move between panes from a tag and each tag keeps its cur test "tags: a tag's normal mode is the body's: motions stay in the tag and insert types into it" { var s = try Session.initFile(std.testing.allocator, "body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const first = try s.focused(); try s.write("/ctl", "Newcol\n"); const right_pane = try s.newPane(); @@ -189,6 +201,8 @@ test "tags: a tag's normal mode is the body's: motions stay in the tag and inser test "tags: a tag with a newline in it is as tall as its lines, and each line is typed into and pointed at" { var s = try Session.initFile(std.testing.allocator, "body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); // Insert mode in a tag is a body's: Enter is a new line. try s.keys(":A\nSecond"); @@ -292,6 +306,8 @@ fn clickPathEnd(s: *Session, path: []const u8) !void { test "tags: a name drafted in the tag commits with Enter, cancels with two Escs, and changes neither body nor tag text" { var s = try Session.initFile(std.testing.allocator, "original body\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); const name = s.at("/pane/{d}/name", .{n}); try s.write(s.at("/pane/{d}/tag", .{n}), " JumpTrail"); @@ -317,6 +333,8 @@ test "tags: a name drafted in the tag commits with Enter, cancels with two Escs, test "tags: a drafted name's edits are by grapheme, and an empty one is not committed" { var s = try Session.initFile(std.testing.allocator, "untouched\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); try clickPathEnd(&s, "/test.txt"); try s.keys("\x15/café界\x08"); @@ -353,6 +371,8 @@ test "tags: leaving a pane or entering a header drops an uncommitted name" { test "tags: middle clicking Save commits the drafted name before saving" { var s = try Session.initFile(std.testing.allocator, "untouched\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); try clickPathEnd(&s, "/test.txt"); try s.keys("\x15/renamed.txt"); @@ -429,6 +449,8 @@ test "tags: a pane's tag reads whole, its path first, and a write appends to its test "tags: truncating a tag clears its own text, u in the tag undoes it, and > drops the one newline ending it" { var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5). + try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n"); const n = try s.focused(); const path = s.at("/pane/{d}/tag", .{n}); try s.write(path, " Mine"); |
