summaryrefslogtreecommitdiff
path: root/test/process/tty_layout.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/process/tty_layout.zig')
-rw-r--r--test/process/tty_layout.zig88
1 files changed, 52 insertions, 36 deletions
diff --git a/test/process/tty_layout.zig b/test/process/tty_layout.zig
index 00197a5c..77acd71e 100644
--- a/test/process/tty_layout.zig
+++ b/test/process/tty_layout.zig
@@ -25,7 +25,7 @@ fn colgrip(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
defer t.deinit();
try t.file("w.txt", "x");
try t.start(24, 100, &.{"w.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "w.txt");
try t.stable(700, 20000);
try t.key("a-n");
@@ -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,29 +68,35 @@ 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);
+ try t.press("middle", "@Collapse", 2);
+ try t.release("middle", "@Collapse", 2);
try t.stable(500, 8000);
try t.snap("middle-collapsed");
// The terminal remembers its last cursor position even when hidden. The core
// screen explicitly reports null, guarding against a leaked body caret.
try t.snap9p("middle-collapsed-cursor");
- try t.press("middle", "@Collapse", 3);
- try t.release("middle", "@Collapse", 3);
+ try t.press("middle", "@Collapse", 2);
+ try t.release("middle", "@Collapse", 2);
try t.wait(8000, "KEEP-THIRD");
try t.stable(500, 8000);
try t.snap("middle-restored");
- try t.press("left", "@Collapse", 3);
- try t.release("left", "@Collapse", 3);
+ try t.press("left", "@Collapse", 2);
+ try t.release("left", "@Collapse", 2);
try t.key("esc");
try t.settle(100);
try t.key("tab");
try t.stable(500, 8000);
try t.snap("tab-collapsed");
try t.snap9p("tab-collapsed-cursor");
- try t.press("left", "@Collapse", 3);
- try t.release("left", "@Collapse", 3);
+ try t.press("left", "@Collapse", 2);
+ try t.release("left", "@Collapse", 2);
try t.key("esc");
try t.settle(100);
try t.key("tab");
@@ -96,8 +104,8 @@ fn collapse(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.stable(500, 8000);
try t.snap("tab-restored");
// Save via the visible tag; the original bytes must survive all four toggles.
- try t.press("middle", "@Save", 3);
- try t.release("middle", "@Save", 3);
+ try t.press("middle", "@Save", 2);
+ try t.release("middle", "@Save", 2);
try t.stable(500, 8000);
try t.snapFile("unchanged", "kept.txt");
try t.done();
@@ -163,22 +171,22 @@ fn delask(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.settle(100);
try t.stable(400, 5000);
try t.snap("typed");
- try t.press("middle", "@DelBelow", 21);
- try t.release("middle", "@DelBelow", 21);
+ try t.press("middle", "@DelBelow", 20);
+ try t.release("middle", "@DelBelow", 20);
try t.stable(700, 10000);
try t.snap("below-took-click");
// a fresh pane at the foot of the column (acme's New takes the bottom half of
// the last pane), and the third one, now between the file and it, closed by a
// middle click on its tag's Del: no question, and the rows go up as they
// always have
- 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(400, 5000);
try t.key("space f n");
try t.stable(400, 5000);
try t.snap("four");
- try t.press("middle", "@Del", 20);
- try t.release("middle", "@Del", 20);
+ try t.press("middle", "@Del", 19);
+ try t.release("middle", "@Del", 19);
try t.stable(700, 10000);
try t.snap("mouse-del");
try t.done();
@@ -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);
@@ -411,7 +419,7 @@ fn tagalign(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.dir("deep/nested-project-directory");
try t.file("deep/nested-project-directory/document.txt", "alpha\nbeta\ngamma");
try t.start(31, 100, &.{"deep/nested-project-directory/document.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "document.txt");
try t.stable(700, 20000);
try t.key("a-n");
@@ -426,8 +434,8 @@ fn tagalign(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.snap("overby1");
try t.resize(31, 100);
try t.stable(700, 15000);
- try t.press("left", "12", 3);
- try t.release("left", "12", 3);
+ try t.press("left", "12", 2);
+ try t.release("left", "12", 2);
try t.stable(400, 5000);
try t.snap("clicked");
// The click was on the path, so it drafted a name; Esc keeps it pending and
@@ -443,8 +451,8 @@ fn tagalign(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.key("A");
try t.stable(400, 5000);
try t.snap("revealed");
- try t.press("middle", "@Del", 4);
- try t.release("middle", "@Del", 4);
+ try t.press("middle", "@Del", 3);
+ try t.release("middle", "@Del", 3);
try t.stable(700, 15000);
try t.snap("alone");
try t.done();
@@ -458,7 +466,7 @@ fn tagalign2col(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.dir("deep/proj");
try t.file("deep/proj/document.txt", "alpha\nbeta\ngamma");
try t.start(31, 160, &.{"deep/proj/document.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "document.txt");
try t.stable(700, 20000);
// A shell in a separate right-hand column.
@@ -497,7 +505,7 @@ fn windownav(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
defer t.deinit();
try t.file("w.txt", "alpha\nbeta\ngamma");
try t.start(31, 100, &.{"w.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "w.txt");
try t.stable(700, 20000);
// A FILE boots alone now, so the terminal every hop below needs is opened here:
@@ -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);
@@ -604,7 +612,15 @@ fn windowops(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.key("c-w l enter");
try t.stable(400, 5000);
try t.snap("focus-right");
- // Debug overlay on (topbar middle-click on Debug), then off
+ // Debug overlay on, then off: B2 on Debug, a word that left the window
+ // row (UX K'4), typed into its own text after its words (A appends at
+ // the line's end)
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
+ try t.send("Debug");
+ try t.key("esc");
+ try t.stable(400, 8000);
try t.press("middle", "@Debug", 1);
try t.release("middle", "@Debug", 1);
try t.stable(400, 8000);