diff options
Diffstat (limited to 'test/process')
| -rw-r--r-- | test/process/tty_editing.zig | 196 | ||||
| -rw-r--r-- | test/process/tty_images.zig | 11 | ||||
| -rw-r--r-- | test/process/tty_layout.zig | 30 | ||||
| -rw-r--r-- | test/process/tty_terminals.zig | 22 |
4 files changed, 136 insertions, 123 deletions
diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index a5d58906..bdd84dc5 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -392,42 +392,42 @@ fn chordcut(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 15000); try t.snap("opened"); // 1-2 Cut: left-drag over "line" on line 2, tap middle while holding - try t.press("left", "8", 10); - try t.drag("left", "11", 10); - try t.press("middle", "11", 10); - try t.release("middle", "11", 10); - try t.release("left", "11", 10); + try t.press("left", "8", 8); + try t.drag("left", "11", 8); + try t.press("middle", "11", 8); + try t.release("middle", "11", 8); + try t.release("left", "11", 8); try t.stable(400, 5000); try t.snap("cut"); // 1-2 then 1-3 in one hold = copy: line 3 keeps its text, register loaded - try t.press("left", "8", 11); - try t.drag("left", "11", 11); - try t.press("middle", "11", 11); - try t.release("middle", "11", 11); - try t.press("right", "11", 11); - try t.release("right", "11", 11); - try t.release("left", "11", 11); + try t.press("left", "8", 9); + try t.drag("left", "11", 9); + try t.press("middle", "11", 9); + try t.release("middle", "11", 9); + try t.press("right", "11", 9); + try t.release("right", "11", 9); + try t.release("left", "11", 9); try t.stable(400, 5000); try t.snap("copied"); // 1-3 at a bare click point: hold left past the end of line 4, tap right — // the register splices in at the click - try t.press("left", "14", 12); - try t.press("right", "14", 12); - try t.release("right", "14", 12); - try t.release("left", "14", 12); + try t.press("left", "14", 10); + try t.press("right", "14", 10); + try t.release("right", "14", 10); + try t.release("left", "14", 10); try t.stable(400, 5000); try t.snap("pointpaste"); // 1-3 over a fresh selection replaces it with the register - try t.press("left", "9", 13); - try t.drag("left", "11", 13); - try t.press("right", "11", 13); - try t.release("right", "11", 13); - try t.release("left", "11", 13); + try t.press("left", "9", 11); + try t.drag("left", "11", 11); + try t.press("right", "11", 11); + try t.release("right", "11", 11); + try t.release("left", "11", 11); try t.stable(400, 5000); try t.snap("replaced"); // arm the cancel tests: append `echo B''OO g.txt` to line 2 - try t.press("left", "10", 10); - try t.release("left", "10", 10); + try t.press("left", "10", 8); + try t.release("left", "10", 8); try t.stable(400, 5000); try t.key("i"); try t.send("echo B''OO g.txt"); @@ -436,56 +436,56 @@ fn chordcut(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // 2-3 cancel (acme textselect2): tap right during the middle execute-drag // over `echo B''OO` — the command never runs (no BOO anywhere) - try t.press("middle", "10", 10); - try t.drag("middle", "19", 10); - try t.press("right", "19", 10); - try t.release("right", "19", 10); - try t.release("middle", "19", 10); + try t.press("middle", "10", 8); + try t.drag("middle", "19", 8); + try t.press("right", "19", 8); + try t.release("right", "19", 8); + try t.release("middle", "19", 8); try t.stable(700, 8000); try t.snap("cancelexec"); // the same drag released clean proves the word was live: BOO appears - try t.press("middle", "10", 10); - try t.drag("middle", "19", 10); - try t.release("middle", "19", 10); + try t.press("middle", "10", 8); + try t.drag("middle", "19", 8); + try t.release("middle", "19", 8); try t.wait(10000, "BOO"); try t.stable(700, 10000); try t.snap("execafter"); // 3-1 cancel (acme textselect3): tap left during the right look-drag over // g.txt — no pane opens - try t.press("right", "21", 10); - try t.drag("right", "25", 10); - try t.press("left", "25", 10); - try t.release("left", "25", 10); - try t.release("right", "25", 10); + try t.press("right", "21", 8); + try t.drag("right", "25", 8); + try t.press("left", "25", 8); + try t.release("left", "25", 8); + try t.release("right", "25", 8); try t.stable(700, 8000); try t.snap("cancellook"); // the same look released clean opens g.txt - try t.press("right", "21", 10); - try t.drag("right", "25", 10); - try t.release("right", "25", 10); + try t.press("right", "21", 8); + try t.drag("right", "25", 8); + try t.release("right", "25", 8); try t.wait(10000, "line 2"); try t.stable(700, 10000); try t.snap("lookafter"); // a fresh left click dismisses the chord's leftover selection instead of // dragging the anchored span to the click: copy `line` on g.txt line 1 // (styled snap shows the selection), then click the next row (it's gone) - try t.press("left", "8", 24); - try t.drag("left", "11", 24); - try t.press("middle", "11", 24); - try t.release("middle", "11", 24); - try t.press("right", "11", 24); - try t.release("right", "11", 24); - try t.release("left", "11", 24); + try t.press("left", "8", 23); + try t.drag("left", "11", 23); + try t.press("middle", "11", 23); + try t.release("middle", "11", 23); + try t.press("right", "11", 23); + try t.release("right", "11", 23); + try t.release("left", "11", 23); try t.stable(400, 5000); try t.style("chordsel"); - try t.press("left", "8", 25); - try t.release("left", "8", 25); + try t.press("left", "8", 24); + try t.release("left", "8", 24); try t.stable(400, 5000); try t.style("clickdismiss"); // g.txt opened under the lower shell's text and left it three rows: close it, // and the shell grows back into its rows, for what follows to run in - try t.press("middle", "59", 23); - try t.release("middle", "59", 23); + try t.press("middle", "@Del", 22); + try t.release("middle", "@Del", 22); try t.stable(700, 15000); // tty paste chord: over a mouse-listening app B1 is the app's, so the // chord's B1 holds Shift (B3 is pardes's either way); the app gets a click @@ -554,31 +554,31 @@ fn selarg(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(600, 8000); // keep a left selection over ZZARG in pane A (this also focuses A) - try t.press("left", "3", 5); - try t.drag("left", "7", 5); - try t.release("left", "7", 5); + try t.press("left", "3", 4); + try t.drag("left", "7", 4); + try t.release("left", "7", 4); try t.stable(400, 5000); try t.snap("kept"); // chord in pane B: middle on ./c.sh + left tap (B has NO selection: the // argument comes from pane A's kept left selection) + middle release runs - try t.press("middle", "55", 5); - try t.press("left", "55", 5); - try t.release("middle", "55", 5); - try t.release("left", "55", 5); + try t.press("middle", "55", 4); + try t.press("left", "55", 4); + try t.release("middle", "55", 4); + try t.release("left", "55", 4); try t.wait(10000, "CHORDARG:ZZARG"); try t.stable(700, 10000); try t.snap("crosspane"); // now an explicit modal selection: plain-click ZZVEE in A (drops A's kept // left selection), select it with v e, chord in B again - try t.press("left", "9", 5); - try t.release("left", "9", 5); + try t.press("left", "9", 4); + try t.release("left", "9", 4); try t.stable(400, 5000); try t.send("ve"); try t.stable(400, 5000); - try t.press("middle", "55", 5); - try t.press("left", "55", 5); - try t.release("middle", "55", 5); - try t.release("left", "55", 5); + try t.press("middle", "55", 4); + try t.press("left", "55", 4); + try t.release("middle", "55", 4); + try t.release("left", "55", 4); try t.wait(10000, "CHORDARG:ZZVEE"); try t.stable(700, 10000); try t.snap("vselarg"); @@ -1061,14 +1061,14 @@ fn lookpanes(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // an ordinary dir look on the shell's own ls output: alpha's directory pane, // split below it, which takes the keyboard - try t.press("right", "@alpha", 6); - try t.release("right", "@alpha", 6); + try t.press("right", "@alpha", 5); + try t.release("right", "@alpha", 5); try t.wait(10000, "amark.txt"); try t.stable(700, 20000); // type the words to look into what is left of the workdir shell (past its own // ls output, on the same row: its last row is the resize handle) - try t.press("left", "95", 5); - try t.release("left", "95", 5); + try t.press("left", "95", 4); + try t.release("left", "95", 4); try t.stable(400, 5000); try t.key("i"); try t.send("zqonly.txt pick.txt twin.txt"); @@ -1077,42 +1077,42 @@ fn lookpanes(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("shells"); // make the beta pane the most recently focused, so the walk has to pass it - try t.press("left", "10", 5); - try t.release("left", "10", 5); + try t.press("left", "10", 4); + try t.release("left", "10", 4); try t.stable(700, 10000); // zqonly.txt is only under alpha: the clicked shell's cwd fails, beta fails, // alpha's directory pane answers. Before, this word became a search. - try t.press("right", "@zqonly.txt", 5); - try t.release("right", "@zqonly.txt", 5); + try t.press("right", "@zqonly.txt", 4); + try t.release("right", "@zqonly.txt", 4); try t.wait(10000, "ONLY-IN-ALPHA"); try t.stable(700, 20000); try t.snap("other-dir"); // both.txt is in BOTH dirs and alpha is now the most recent (its file pane // just opened), but the CLICK still wins: looked inside the beta pane it // opens beta's copy - try t.press("right", "10", 5); - try t.release("right", "10", 5); + try t.press("right", "10", 4); + try t.release("right", "10", 4); try t.wait(10000, "BOTH-FROM-BETA"); try t.stable(700, 20000); try t.snap("clicked-wins"); // from a pane whose own dir holds neither copy the access order decides: // focus alpha's directory pane (a click on its first row), look pick.txt (in // both dirs) from the workdir shell -> alpha's - try t.press("left", "@amark.txt", 9); - try t.release("left", "@amark.txt", 9); + try t.press("left", "@amark.txt", 8); + try t.release("left", "@amark.txt", 8); try t.stable(700, 10000); - try t.press("right", "@pick.txt", 5); - try t.release("right", "@pick.txt", 5); + try t.press("right", "@pick.txt", 4); + try t.release("right", "@pick.txt", 4); try t.wait(10000, "PICK-FROM-ALPHA"); try t.stable(700, 20000); try t.snap("mru-alpha"); // focus the beta pane instead and the same look flips: twin.txt is in both // dirs, beta is most recent, beta's copy opens - try t.press("left", "10", 5); - try t.release("left", "10", 5); + try t.press("left", "10", 4); + try t.release("left", "10", 4); try t.stable(700, 10000); - try t.press("right", "@twin.txt", 5); - try t.release("right", "@twin.txt", 5); + try t.press("right", "@twin.txt", 4); + try t.release("right", "@twin.txt", 4); try t.wait(10000, "TWIN-FROM-BETA"); try t.stable(700, 20000); try t.snap("mru-beta"); @@ -2390,8 +2390,10 @@ fn follow(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // `:` — vim's command line with acme's vocabulary. It focuses the pane's OWN // tag in NORMAL mode (block cursor; the layout box shows the pane's BODY mode, // which for this file pane is normal either way). The tag remembers where its -// cursor was; the first time there is nothing to remember and it starts on -// Save. The tag's normal mode is the body's: w selects the "Save" span exactly +// cursor was; the first time there is nothing to remember and it starts at +// the start of the tag's own text, after the computed words (`Save Undo Del` +// on this edited file). The tag's normal mode is the body's: b steps back +// over the words onto Save, w selects the "Save" span exactly // as a body word motion does, and the execute key runs the word under the // cursor and hands the body back — same keys as the body, so Tab by default // (see config.look_key/exec_key). `:` again backs out instead, leaving the tag @@ -2411,10 +2413,12 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.settle(100); try t.stable(400, 5000); try t.snap("edited"); - // `:` -> the tag, in normal mode, cursor on Save + // `:` -> the tag, in normal mode, cursor at its own text try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); + // b three times: back over Del and Undo onto Save; `;` keeps the cursor alone + try t.key("b b b ;"); // w -> the "Save" span (selected, like the body's word motion) try t.key("w"); try t.stable(400, 5000); @@ -2439,7 +2443,7 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // there are no tag-only hops. `:` is the one key a tag and a body do not // share: from the body it focuses the pane's own tag, from the tag it hands the // keyboard back to the body. Each tag remembers its cursor; the first time -// there is nothing to remember and it starts on Save. +// there is nothing to remember and it starts at the start of the tag's own text. // // Evidence is the `cursor=` header (the ACTIVE pane's cursor, which while a tag // is focused sits on THAT pane's tag row) plus each pane's layout box, which @@ -2472,12 +2476,13 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("space w k enter"); try t.stable(400, 5000); try t.snap("start"); - // `:` -> the file's OWN tagline, normal mode, on Save + // `:` -> the file's OWN tagline, normal mode, at its own text try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); - // w selects in the tag the way it selects in a body - try t.key("w"); + // w selects in the tag the way it selects in a body: from the tag's start + // (`0`; the cursor starts after the computed words, here the tag's end) + try t.key("0 w"); try t.stable(400, 5000); try t.snap("word"); // l is a motion in the tag, not a hop to the next pane @@ -2489,7 +2494,7 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-w l enter"); try t.stable(400, 5000); try t.snap("right"); - // `:` there -> that pane's own tag, on its Save the first time + // `:` there -> that pane's own tag, at its own text the first time try t.key(": :"); try t.stable(400, 5000); try t.snap("right-tag"); @@ -2511,8 +2516,8 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(700, 15000); try t.snap("tty-on"); - try t.press("left", "@Mode", 3); - try t.release("left", "@Mode", 3); + try t.press("left", "@Term+bash", 3); + try t.release("left", "@Term+bash", 3); try t.stable(400, 5000); try t.snap("tty-tag"); try t.key(":"); @@ -2638,13 +2643,12 @@ fn tag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(31, 150, &.{ "-n", "3" }); try t.wait(8000, "t.txt"); try t.stable(700, 20000); - // Click the one editable separator before Save, directly after the cwd. - // The former generated alignment gap no longer exists. - // The layout box shows + // Click just past the end of the tag's own text (Term+bash, after the + // computed words). The layout box shows // the pane's BODY mode, not the tag's; `i` then types into the tag where it // was clicked. - try t.press("left", "@Save-1", 3); - try t.release("left", "@Save-1", 3); + try t.press("left", "@Term+bash+9", 3); + try t.release("left", "@Term+bash+9", 3); try t.stable(400, 5000); try t.snap("tag-focus"); try t.key("i"); diff --git a/test/process/tty_images.zig b/test/process/tty_images.zig index 9c37a40d..bb9da072 100644 --- a/test/process/tty_images.zig +++ b/test/process/tty_images.zig @@ -8,7 +8,7 @@ pub const cases = .{ // image panes: right-click a .ppm opens petscii glyph art (no kitty in the // harness). The tag starts with the renderer's plain state fields followed by -// its path and `Term Del`; the fields are display-only, while their toggles are +// its path and `Del`; the fields are display-only, while their toggles are // builtins under SPC t (the old clickable tag words sat past the pane's right // edge, so clicking them only ever hit the neighbouring shell's tag). fn images(gpa: std.mem.Allocator, exe: [:0]const u8) !void { @@ -53,12 +53,13 @@ fn images(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // prefix is wider than this source-local column, so widen the grid for this // final assertion. (A column grip drag intentionally takes width from only // one neighbour, which cannot expose this 82-column prefix.) Then click the - // visible tail itself, at its `Term`. This proves the image tag is an ordinary - // editor rather than accidentally typing at a clipped read-only path. + // visible tail itself, past its `Del`, where its own text starts. This proves + // the image tag is an ordinary editor rather than accidentally typing at a + // clipped read-only path. try t.resize(31, 400); try t.stable(400, 5000); - try t.press("left", "@Term", 7); - try t.release("left", "@Term", 7); + try t.press("left", "@Del+4", 7); + try t.release("left", "@Del+4", 7); try t.stable(400, 5000); try t.key("i"); try t.send("Zork "); diff --git a/test/process/tty_layout.zig b/test/process/tty_layout.zig index 00197a5c..76bed736 100644 --- a/test/process/tty_layout.zig +++ b/test/process/tty_layout.zig @@ -56,7 +56,9 @@ fn colgrip(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.done(); } -// A default pane-tag command collapses to one row and restores the body. +// A pane-tag command collapses to one row and restores the body. Collapse +// and Save are no computed words of a clean file's tag (UX K'1), so they are +// typed into the tag's own text first, where a click runs them as before. // Exercise real middle clicks twice, then the tag's own execute key twice: a // click types into the tag, Esc is its normal mode, and Tab executes there. fn collapse(gpa: std.mem.Allocator, exe: [:0]const u8) !void { @@ -66,6 +68,12 @@ fn collapse(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(25, 160, &.{"kept.txt"}); try t.wait(8000, "KEEP-THIRD"); try t.stable(500, 15000); + try t.key(": : i"); + try t.send("Collapse Save"); + try t.key("esc"); + try t.settle(100); + try t.key(":"); + try t.stable(400, 5000); try t.snap("before"); try t.press("middle", "@Collapse", 3); try t.release("middle", "@Collapse", 3); @@ -335,9 +343,9 @@ fn layout_open(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // execute the file's command (middle drag over line 1): it runs as a command // pane for sub/, forked at the bottom of the rightmost column, splitting only // the pane above it - try t.press("middle", "8", 25); - try t.drag("middle", "19", 25); - try t.release("middle", "19", 25); + try t.press("middle", "8", 23); + try t.drag("middle", "19", 23); + try t.release("middle", "19", 23); try t.wait(10000, "TTYOK"); try t.motion("40", 27); try t.stable(700, 10000); @@ -369,7 +377,7 @@ fn shrinktag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("before"); // drag the lower pane's grip up under pane 0's tag row: it keeps 2 body rows - try t.press("left", "1", 18); + try t.press("left", "1", 17); try t.drag("left", "1", 3); try t.release("left", "1", 3); try t.motion("40", 25); @@ -386,15 +394,15 @@ fn shrinktag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // re-enlarge: the lower pane's grip, now under pane 0's 2 body rows, pulled // back down - try t.press("left", "1", 7); - try t.drag("left", "1", 18); - try t.release("left", "1", 18); + try t.press("left", "1", 6); + try t.drag("left", "1", 17); + try t.release("left", "1", 17); try t.motion("40", 25); try t.stable(500, 8000); try t.snap("restored"); // the bottom pane stops at ITS tag and 2 rows too: its grip dragged past the // bottom - try t.press("left", "1", 18); + try t.press("left", "1", 17); try t.drag("left", "1", 31); try t.release("left", "1", 31); try t.motion("40", 25); @@ -578,9 +586,9 @@ fn windowops(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.motion("20", 16); try t.stable(400, 5000); try t.snap("hover-h"); - // resize the left pair by the lower pane's grip, 4 rows up (a terminal has no + // resize the left pair by the lower pane's grip, 3 rows up (a terminal has no // rule between panes; pane 0's last row is now 13) - try t.press("left", "1", 18); + try t.press("left", "1", 17); try t.drag("left", "1", 14); try t.release("left", "1", 14); try t.stable(500, 8000); diff --git a/test/process/tty_terminals.zig b/test/process/tty_terminals.zig index a49d3696..86eab7b7 100644 --- a/test/process/tty_terminals.zig +++ b/test/process/tty_terminals.zig @@ -125,8 +125,8 @@ fn ttyedit(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(600, 8000); // click into the middle of the first output row - try t.press("left", "8", 9); - try t.release("left", "8", 9); + try t.press("left", "8", 8); + try t.release("left", "8", 8); try t.stable(400, 5000); try t.snap("before"); // Enter splits the row there: "one t" stays, "wo three" becomes a real line @@ -303,8 +303,8 @@ fn ttylook(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // selection: the cursor word expands): the click puts it on the ls command // line's `ls`, a word no file names, which a terminal lists in a +Search, // its row the place in that terminal (@p1:1:1-2) - try t.press("left", "4", 5); - try t.release("left", "4", 5); + try t.press("left", "4", 4); + try t.release("left", "4", 4); try t.stable(400, 5000); try t.key("enter"); try t.wait(10000, "@p1:1:1-2"); @@ -597,8 +597,8 @@ fn respawn(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 20000); // middle-click Del on the lower-left pane's tag: the pane id is freed while // its shell process stays alive in the slot - try t.press("middle", "@Collapse+9", 18); - try t.release("middle", "@Collapse+9", 18); + try t.press("middle", "@Del", 18); + try t.release("middle", "@Del", 18); try t.stable(700, 10000); // Alt-n reuses the freed id -> spawn effect lands on the occupied slot try t.key("a-n"); @@ -707,7 +707,7 @@ fn look_fd_deep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.send("cd a && ls && fd"); try t.key("enter"); try t.wait(8000, "c.txt"); - try t.wait(8000, "cwd/a Term"); + try t.wait(8000, "cwd/a Del Term"); try t.stable(700, 20000); try t.snap("listed"); try t.press("right", "6", 8); @@ -752,10 +752,10 @@ fn ghostty_mid(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(600, 8000); try t.send("\x1b[I"); - try t.send("\x1b[<35;10;10M\x1b[<35;7;8M\x1b[<35;4;6M"); - try t.send("\x1b[<1;4;6M"); - try t.send("\x1b[<1;4;6m"); - try t.send("\x1b[<35;6;6M"); + try t.send("\x1b[<35;10;9M\x1b[<35;7;7M\x1b[<35;4;5M"); + try t.send("\x1b[<1;4;5M"); + try t.send("\x1b[<1;4;5m"); + try t.send("\x1b[<35;6;5M"); try t.wait(10000, "GHOSTOK"); try t.stable(700, 10000); try t.snap("ghostty-mid"); |
