diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-25 02:39:31 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 03:06:39 -0300 |
| commit | 3845a3eb8dd009ac1f2d184e6d15439e27065b66 (patch) | |
| tree | 868d7bb1088b3ccbd21eda28b98bb87513c76fc0 /test/behaviour | |
| parent | 5b065b537f15120184a6938d963d7302d0e4cc8d (diff) | |
| parent | 09729fc927bca5f05f99de7844069cae445598a1 (diff) | |
| download | pardes-3845a3eb8dd009ac1f2d184e6d15439e27065b66.tar.gz pardes-3845a3eb8dd009ac1f2d184e6d15439e27065b66.zip | |
walk UI M4: line E2's `:` merged (kwuzwsmo, on E's tip tuwqwmlm, which G2's tip wyplmmyp holds): TagState keeps G2's kinds {rest, help, describe, pick, rename, prompt}, `:` a prompt op whose arms (Prompt.key, head, takes, steps; TagState.point beside G2's pick arm) merged as E2 wrote them, and max_hits as many as the themes; THE STAND-IN GOES: Messages.zig's block from `---- a stand-in for line C's questions` to `---- the stand-in's end ----` and root.zig's allowed_vars `stub_asked` deleted, C's real Answer, waiting, waitingAnswers and answer kept, and Command.zig's test asks as C's own does (a file changed on disk under unsaved text), its @hasDecl branches gone; ONE THEME PREVIEW: `:theme ` goes through G2's colors.previewTheme as the themes picker does, its current row worn at each change of the rows and again after every step (Prompt.settle, as Pick.produceAll re-derives the picker's), off at rest (TagState.toRest, for a view that previewed the whole window), no pane dimmed while it does; DELETED: colors.wear, colors.wornChrome, TagState.worn (its replica index and isTheme), Pardes.worn_chrome (its `.derived` and kept_out entries), draw.render's wornChrome call; finishThemeInitialization keeps E2's change (the session's own theme's chrome, never a preview's: a load meanwhile); fs.zig: E2's Namespace.deinit hold (`@min(opens_len, opens.len)`) and its shell test dropped: H's `opens_len = 0` before the teardown in both load paths' errdefers (dump.zig) covers the same fault on the one path that meets it (a refused load; fuzz join seed 31554 pinned), and no other caller tears a namespace down with a count it did not hold; `:open ` IS D's FIND: the line `open ` (or `o `) hands itself to Find from this pane, as B2 on `Find <rest>` runs it (where jumps walk a Find picker in the tag, the rest of the line its query: every path, listed and scored off the loop by Names), so Command's own file rows (fileOf, firstOf, shownPath: the files the panes show) are deleted and the head's plain word for `open` is `Exec Find`; A MERGE FAULT FOUND BY A TEST FIRST: TagState.loaded (A2's) held every view's hits to the tree's leaves and the registry's words, so a view in `:theme ` on a row past bindings.flat.len + the kinds' words (the last theme, 272, is) came back from a dump at rest: a client joining a session with a view in `:theme ` would have that view at rest where the session had it in `:` (the digest's view state apart); `:`'s hits are held by Command.zig where it reads them (rowOf, theme, the preview: each bounds its index), so loaded skips the leaves' bound for a `:` view; TEST: Command.zig "a view in :theme on its last row keeps it through a dump and a load" (fails on the merge without it: the loaded view at rest); goldens: ttytaken (the conflict) regenerated and read: G2's with E2's one row (`|5: echo TAKEN''ONE`, as E2 read it); tagnav (no conflict, failed after the merge) regenerated and read: in raw tty mode the shell's prompt row 6 (`$ `) is no longer drawn at tty-on, nor taken away at column-tag: the case's `: :` in the terminal pane opens `:`'s band there, the band's rows come out of the terminal's body, its pty is resized smaller and back (the band class of item 4, A's band term), and the shell's redraw leaves that row blank (RUN: with `:`'s band held at 0 rows in a terminal pane, a temporary edit put back, tagnav matches G2's golden); a user meets it: `:` (any band) in a terminal pane resizes its pty while it is open; gates: core-test 1061/1231 (170 skipped), shell-test 1278/1281, pane-test 183/184, behaviour-test 277/277, process-test 1/146 (tagnav), then tagnav alone after its regeneration 0/1, term-test 17/17, kitty-test 45/45; the 40,000-seed fuzz meets item 2's fault (join seed 6356 here)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'test/behaviour')
| -rw-r--r-- | test/behaviour/keys.zig | 6 | ||||
| -rw-r--r-- | test/behaviour/panes.zig | 2 | ||||
| -rw-r--r-- | test/behaviour/tags.zig | 48 |
3 files changed, 28 insertions, 28 deletions
diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig index e02b1fa5..6a62ccd7 100644 --- a/test/behaviour/keys.zig +++ b/test/behaviour/keys.zig @@ -40,7 +40,7 @@ test "keys: a prompt's entry and cancellation leave the tag, the body and its cu // Save on a scratch asks for a path, starting from its directory. const scratch = try s.newPane(); const scratch_tag = try s.read(s.at("/pane/{d}/tag", .{scratch})); - try s.keys(":\tzq"); + try s.keys("::\tzq"); _ = try s.where("/zq"); try s.expect(s.at("/pane/{d}/tag", .{scratch}), scratch_tag); try s.keys("\x1b"); @@ -272,7 +272,7 @@ test "keys: Save's prompt on a scratch starts from the scratch's directory, one // New from the file's pane: a scratch in its directory. try s.write(s.at("/pane/{d}/exec", .{n}), "New\n"); try std.testing.expect(try s.focused() != n); - try s.keys(":\tzq"); + try s.keys("::\tzq"); _ = try s.where(c[1]); try s.keys("\x1b"); } @@ -380,7 +380,7 @@ test "keys: a PDF in normal mode keeps : (its tag and back), SPC (a leader, canc try std.testing.expect(try s.cursor() == null); _ = try s.pdfPage(n); const tag = (try s.where("[1/"))[1]; - try s.keys(":"); + try s.keys("::"); // On its tag, which runs to three rows (its path, the core's art words). const on_tag = (try s.cursor()).?[1]; try std.testing.expect(on_tag >= tag and on_tag <= tag + 2); diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig index 96bae187..4c76df25 100644 --- a/test/behaviour/panes.zig +++ b/test/behaviour/panes.zig @@ -252,7 +252,7 @@ test "panes: Collapse keeps the text and folds the pane to its tag, and again re try s.expect(s.at("/pane/{d}/body", .{n}), "keep this text\n"); try s.expect(s.at("/pane/{d}/dirty", .{n}), "0\n"); // Its tag still takes the keyboard, the cursor on the tag's row. - try s.keys(":"); + try s.keys("::"); try std.testing.expectEqual((try s.where("/test.txt"))[1], (try s.cursor()).?[1]); try s.write(ctl, "Collapse\n"); try std.testing.expect(std.mem.indexOf(u8, try s.read(ctl), " collapsed ") == null); diff --git a/test/behaviour/tags.zig b/test/behaviour/tags.zig index e4e4c04b..c8de115b 100644 --- a/test/behaviour/tags.zig +++ b/test/behaviour/tags.zig @@ -27,7 +27,7 @@ test "tags: s and S in a tag answer for the tag's own text; / still searches the 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. - try s.keys(":xsS\ncZ\x1b"); + try s.keys("::xsS\ncZ\x1b"); try std.testing.expectEqualStrings("/test.txt Zave Del Znarf", try tag(&s, n)); try s.expect(s.at("/pane/{d}/body", .{n}), "Some body\n"); // `/` from the tag is the body's search, as acme's Look from a tag is. @@ -42,7 +42,7 @@ test "tags: ms and md edit a tag's own text, and the text the edit made is read // 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 s.keys("::miwms("); try std.testing.expectEqualStrings("/test.txt (Save) Term Collapse Follow Del", try tag(&s, n)); try s.keys("md("); try std.testing.expectEqualStrings("/test.txt Save Term Collapse Follow Del", try tag(&s, n)); @@ -56,7 +56,7 @@ test "tags: the keyboard reaches a tag's path, which it can select and yank but 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. - try s.keys(":0"); + try s.keys("::0"); try std.testing.expectEqual(@as(usize, 0), try tagCol(&s, "/test.txt")); // An edit that reaches into it is refused, the cursor with it. try s.keys("Eyd"); @@ -69,7 +69,7 @@ test "tags: the keyboard reaches a tag's path, which it can select and yank but try s.keys("\x1b\x1b"); try s.expect(s.at("/pane/{d}/name", .{n}), "/test.txt\n"); // After the path, the text is the tag's own to edit. - try s.keys(":A!\x1b"); + try s.keys("::A!\x1b"); try std.testing.expectEqualStrings("/test.txt Save Term Collapse Follow Del!", try tag(&s, n)); // What it yanked was the path. try s.keys(":P"); @@ -89,7 +89,7 @@ test "tags: a tag remembers its cursor, starts on Save, and a click moves it" { const other = s.at("{d}", .{second}); try s.write("/focus", focus); // Nothing to remember yet: `:` lands on Save. - try s.keys(":"); + try s.keys("::"); try std.testing.expectEqual(@as(usize, "/test.txt ".len), try tagCol(&s, "/test.txt")); // Home is the line's start, the path's: the keyboard reaches it. try s.keys(home ++ right ++ right ++ right); @@ -98,13 +98,13 @@ test "tags: a tag remembers its cursor, starts on Save, and a click moves it" { try s.keys(":"); try std.testing.expect((try s.cursor()).?[1] != (try s.where("/test.txt"))[1]); try s.write("/focus", other); - try s.keys(":" ++ home ++ right ++ right ++ right ++ right ++ right ++ ":"); + try s.keys("::" ++ home ++ right ++ right ++ right ++ right ++ right ++ ":"); try s.write("/focus", focus); - try s.keys(":"); + try s.keys("::"); try std.testing.expectEqual(@as(usize, 3), try tagCol(&s, "/test.txt")); try s.keys(":"); try s.write("/focus", other); - try s.keys(":"); + try s.keys("::"); try std.testing.expectEqual(@as(usize, 5), try tagCol(&s, "/second.txt")); try s.keys(":"); // A click in the tag puts its cursor there, the pane's keyboard with it. @@ -113,7 +113,7 @@ test "tags: a tag remembers its cursor, starts on Save, and a click moves it" { try std.testing.expectEqual(@as(usize, "/test.txt Save T".len), try tagCol(&s, "/test.txt")); // A prompt opened and left from the body leaves it there (a clicked // tag is in normal mode: `:` goes back to the body). - try s.keys(":/\x1b:"); + try s.keys(":/\x1b::"); try std.testing.expectEqual(@as(usize, "/test.txt Save T".len), try tagCol(&s, "/test.txt")); try s.keys(":"); try s.expect(s.at("/pane/{d}/body", .{first}), "body\n"); @@ -127,13 +127,13 @@ test "tags: executing a word from the tag runs it and gives the keyboard back to try s.keys("ix\x1b"); // `:` lands on Save; the execute key runs it, the look key looks // it up. Either way the tag lets go of the keyboard first. - try s.keys(":"); + try s.keys("::"); try s.keys(chord); try std.testing.expectEqual(@as(usize, if (chord[0] == '\t') 1 else 0), s.saved); try s.keys("iQ\x1b"); try s.expect(s.at("/pane/{d}/body", .{n}), "xQbody\n"); // ...and the tag still knows where it was. - try s.keys(":"); + try s.keys("::"); try std.testing.expectEqual(@as(usize, "/test.txt ".len), try tagCol(&s, "/test.txt")); } } @@ -144,13 +144,13 @@ test "tags: a renamed path moves the tag's cursor with the text after it and a s // 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.keys(":::"); // `::` on Save, and `:` back try s.write(s.at("/pane/{d}/name", .{n}), "/界.zig"); - try s.keys(":"); + try s.keys("::"); try std.testing.expectEqual(@as(usize, "/界.zig ".len - 1), try tagCol(&s, "/界")); try s.keys(":"); try s.replace(s.at("/pane/{d}/tag", .{n}), "é"); - try s.keys(":"); + try s.keys("::"); // `/界.zig é`: the cursor is pulled back onto the last character. try std.testing.expectEqual(@as(usize, "/界.zig ".len - 1), try tagCol(&s, "/界")); try s.expect(s.at("/pane/{d}/body", .{n}), "body\n"); @@ -163,13 +163,13 @@ test "tags: window keys move between panes from a tag and each tag keeps its cur const second = try s.newPane(); try s.write(s.at("/pane/{d}/name", .{second}), "/second.txt"); try s.write("/focus", s.at("{d}", .{first})); - try s.keys(":" ++ home ++ "ll" ++ window ++ "j\n"); + try s.keys("::" ++ home ++ "ll" ++ window ++ "j\n"); try std.testing.expectEqual(second, try s.focused()); - try s.keys(":" ++ home ++ "llll" ++ window ++ "k\n"); + try s.keys("::" ++ home ++ "llll" ++ window ++ "k\n"); try std.testing.expectEqual(first, try s.focused()); - try s.keys(":"); + try s.keys("::"); try std.testing.expectEqual(@as(usize, 2), try tagCol(&s, "/test.txt")); - try s.keys(window ++ "j\n:"); + try s.keys(window ++ "j\n::"); try std.testing.expectEqual(@as(usize, 4), try tagCol(&s, "/second.txt")); } @@ -182,7 +182,7 @@ test "tags: a tag's normal mode is the body's: motions stay in the tag and inser try s.write("/ctl", "Newcol\n"); const right_pane = try s.newPane(); try s.write("/focus", s.at("{d}", .{first})); - try s.keys(":" ++ home ++ "l"); + try s.keys("::" ++ home ++ "l"); try std.testing.expectEqual(@as(usize, 1), try tagCol(&s, "/test.txt")); try s.keys("hkj"); try std.testing.expectEqual(@as(usize, 0), try tagCol(&s, "/test.txt")); @@ -191,7 +191,7 @@ test "tags: a tag's normal mode is the body's: motions stay in the tag and inser try std.testing.expectEqual(right_pane, try s.focused()); try s.keys(window ++ "h\n"); try std.testing.expectEqual(first, try s.focused()); - try s.keys(":i\u{F018}hjklHJKL:"); + try s.keys("::i\u{F018}hjklHJKL:"); try std.testing.expectEqualStrings("/test.txt Save Term Collapse Follow DelhjklHJKL:", try tag(&s, first)); try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " mode:normal ")); try s.expect(s.at("/pane/{d}/body", .{first}), "body\n"); @@ -205,7 +205,7 @@ test "tags: a tag with a newline in it is as tall as its lines, and each line is 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"); + try s.keys("::A\nSecond"); try std.testing.expectEqualStrings("/test.txt Save Term Collapse Follow Del\nSecond", try tag(&s, n)); const x, const y = try s.where("/test.txt"); try std.testing.expectEqual(.{ x, y + 1 }, try s.where("Second")); @@ -234,7 +234,7 @@ test "tags: a tag with more lines than rows scrolls to keep its caret in view" { try s.write(s.at("/pane/{d}/tag", .{n}), many.items); const x, const y = try s.where("/test.txt"); // To the last line: the tag scrolls so it is the bottom row, caret on it. - try s.keys(":ge"); + try s.keys("::ge"); const lx, const ly = try s.where("L20"); try std.testing.expectEqual(.{ lx, ly }, (try s.cursor()).?); // What the pointer sees is what is shown: its first row is line 13. @@ -264,7 +264,7 @@ test "tags: a long pane tag wraps onto rows, and a click on a wrapped row maps t try s.write(s.at("/pane/{d}/name", .{n}), "/an/especially/deep/project/path/with/a/long/component/filename.zig"); try s.write(s.at("/pane/{d}/tag", .{n}), " JumpTrail"); const before = try tag(&s, n); - try s.keys(":A"); + try s.keys("::A"); try std.testing.expect((try s.cursor()).?[0] < 50); // JumpTrail is on a row of its own, below the path's. try std.testing.expect((try s.where("JumpTrail"))[1] > (try s.where("/an/"))[1]); @@ -461,7 +461,7 @@ test "tags: truncating a tag clears its own text, u in the tag undoes it, and > s.clunk(h); try std.testing.expectEqualStrings("/test.txt", std.mem.trimEnd(u8, try tag(&s, n), " ")); // The tag keeps its undo: undoing in it brings back what was cleared. - try s.keys(":u:"); + try s.keys("::u:"); try std.testing.expect(std.mem.endsWith(u8, try tag(&s, n), " Mine")); // Written back without a leading space, the text still stands apart // from the path, and a click on its first letter lands on it. |
