summaryrefslogtreecommitdiff
path: root/test/process/tty_boot.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/process/tty_boot.zig')
-rw-r--r--test/process/tty_boot.zig144
1 files changed, 97 insertions, 47 deletions
diff --git a/test/process/tty_boot.zig b/test/process/tty_boot.zig
index 2680a499..2a4fea00 100644
--- a/test/process/tty_boot.zig
+++ b/test/process/tty_boot.zig
@@ -45,7 +45,7 @@ fn argv(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.stable(700, 10000);
try t.snap("noargs");
try t.start(31, 100, &.{"notes.txt:3"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "line 3");
try t.stable(700, 20000);
try t.snap("filearg");
@@ -53,14 +53,14 @@ fn argv(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
// `-n 3` boots the very same single pane (it always did — the file arm never
// looked at the count; before this it merely also stapled a shell to the right)
try t.start(31, 100, &.{ "-n", "3", "notes.txt" });
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "line 1");
try t.stable(700, 20000);
try t.snap("filearg-n3");
try t.dir("sub");
try t.file("sub/inside.txt", "marker");
try t.start(31, 100, &.{"sub"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "inside.txt");
try t.stable(700, 20000);
try t.snap("dirarg");
@@ -77,14 +77,14 @@ fn badutf(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.file("bad.txt", "hello \xff\xfe world\nlatin-1 caf\xe9 tail\ntruncated \xe6\x97 here\nend\n");
try t.file("wide.txt", "日本語 日本語 日本語 日本語 日本語 日本語 日本語 tail\nsecond line\n");
try t.start(31, 100, &.{"bad.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.stable(700, 20000);
try t.snap("badbytes");
// 50 columns, not 100: a FILE boots alone and fills the window, and at 100 the
// whole line fits, so `$` scrolls nowhere. This is
// the width the left column used to be, i.e. the pane this case was written for
try t.start(31, 50, &.{"wide.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.stable(700, 20000);
// SPC t w turns soft wrap OFF: hscroll is the other half of this case and a
// wrapped body has nothing to scroll sideways. The unwrapped view must keep the
@@ -103,7 +103,7 @@ fn boot(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
defer t.deinit();
try t.file("hello.txt", "marker-content");
try t.start(31, 100, &.{ "-n", "1" });
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "hello.txt");
try t.stable(700, 20000);
try t.snap("boot");
@@ -144,20 +144,20 @@ fn builtins(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.key("space j n space j n space j n");
try t.wait(10000, "Look enter, right-click");
try t.wait(10000, "Look at its argument as B3 does");
- try sweepHelp(&t, "@Help#1", 4);
+ try sweepHelp(&t, "@Help#1", 3);
try t.wait(10000, "under SPC c");
try t.wait(10000, "Joincol");
try t.stable(700, 15000);
try t.snap("column-group");
- try sweepHelp(&t, "@Help#2", 4);
+ try sweepHelp(&t, "@Help#2", 3);
try t.wait(10000, "Tutor");
try t.stable(700, 15000);
try t.snap("docs-group");
// Tutor's row, under the documentation of the four before it (Keys,
// describe-key, is SPC h k; Messages' runs to three rows)
- try t.press("middle", "@Tutor", 32);
- try t.release("middle", "@Tutor", 32);
+ try t.press("middle", "@Tutor", 31);
+ try t.release("middle", "@Tutor", 31);
try t.wait(10000, "PARDES TUTOR");
try t.stable(700, 15000);
try t.snap("tutor-from-index");
@@ -182,6 +182,14 @@ fn dump(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.key("esc");
try t.settle(100);
try t.stable(400, 5000);
+ // Dump left the window row (UX K'4): typed into its own text, after its
+ // words (A appends at the line's end), and run there by B2
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
+ try t.send("Dump");
+ try t.key("esc");
+ try t.settle(100);
try t.press("middle", "@Dump", 1);
try t.release("middle", "@Dump", 1);
try t.stable(600, 8000);
@@ -213,6 +221,14 @@ fn load(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.wheel("up", "10", 8);
try t.wheel("up", "10", 8);
try t.stable(500, 8000);
+ // Dump left the window row (UX K'4): typed into its own text, after its
+ // words (A appends at the line's end), and run there by B2
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
+ try t.send("Dump");
+ try t.key("esc");
+ try t.settle(100);
try t.press("middle", "@Dump", 1);
try t.release("middle", "@Dump", 1);
try t.stable(600, 8000);
@@ -233,7 +249,7 @@ fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
defer t.deinit();
t.privateDaemon();
try t.start(31, 100, &.{ "-n", "1" });
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.stable(700, 20000);
try t.key("c-b");
try t.stable(600, 8000);
@@ -241,6 +257,14 @@ fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.key("enter");
try t.wait(8000, "KEEPME");
try t.stable(700, 10000);
+ // Dump left the window row (UX K'4): typed into its own text, after its
+ // words (A appends at the line's end), and run there by B2
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
+ try t.send("Dump");
+ try t.key("esc");
+ try t.settle(100);
try t.press("middle", "@Dump", 1);
try t.release("middle", "@Dump", 1);
try t.stable(700, 10000);
@@ -288,10 +312,11 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.wait(8000, "EPT-COL) exit 0");
try t.stable(700, 15000);
try t.snap("col-swept");
- // the workspace tag, the same
- try t.press("left", "110", 1);
- try t.release("left", "110", 1);
- try t.key("i");
+ // the workspace tag, the same: its own text after its words (UX K'1;
+ // 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.key("space");
try t.send("echo SW''EPT-WS");
try t.key("esc");
@@ -304,9 +329,9 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.snap("ws-swept");
// a right sweep over part of a word looks for the part: `hay.txt` opens,
// where a click would look for all of `xxhay.txtxx`
- try t.press("left", "118", 1);
- try t.release("left", "118", 1);
- try t.key("i");
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
try t.key("space");
try t.send("xxhay.txtxx");
try t.key("esc");
@@ -327,9 +352,9 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.snap("cancelled");
// for comparison, a select sweep over the second column's tag selects, in
// the tag's selection colours, and runs nothing
- try t.press("left", "@Find#2", 2);
- try t.drag("left", "@Grep#2+4", 2);
- try t.release("left", "@Grep#2+4", 2);
+ try t.press("left", "@New#2", 2);
+ try t.drag("left", "@Term#2+4", 2);
+ try t.release("left", "@Term#2+4", 2);
try t.stable(700, 15000);
try t.style("selected");
try t.done();
@@ -345,6 +370,14 @@ fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.start(21, 120, &.{ "-n", "3" });
try t.wait(8000, "Newcol");
try t.stable(700, 20000);
+ // Dump left the window row (UX K'4): typed into its own text, after its
+ // words (A appends at the line's end), and run there by B2
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
+ try t.send("Dump");
+ try t.key("esc");
+ try t.settle(100);
try t.press("middle", "@Dump", 1);
try t.release("middle", "@Dump", 1);
try t.stable(700, 10000);
@@ -367,9 +400,9 @@ fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.wait(8000, "-COL) exit 0");
try t.stable(700, 15000);
try t.snap("col-swept");
- try t.press("left", "118", 1);
- try t.release("left", "118", 1);
- try t.key("i");
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
try t.key("space");
try t.send("echo RE''STORED-WS");
try t.key("esc");
@@ -397,7 +430,7 @@ fn logquiet(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
var t = try Tty.init(gpa, exe, "logquiet");
defer t.deinit();
try t.start(31, 100, &.{ "-n", "1" });
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.stable(700, 20000);
try t.key("c-b");
try t.stable(600, 8000);
@@ -413,8 +446,16 @@ fn tutor(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
var t = try Tty.init(gpa, exe, "tutor");
defer t.deinit();
try t.start(31, 150, &.{ "-n", "3" });
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.stable(700, 20000);
+ // Tutor left the window row (UX K'4): typed into its own text, after its
+ // words (A appends at the line's end), and run there by B2
+ try t.press("left", "@Find", 1);
+ try t.release("left", "@Find", 1);
+ try t.key("A");
+ try t.send("Tutor");
+ try t.key("esc");
+ try t.settle(100);
try t.press("middle", "@Tutor", 1);
try t.release("middle", "@Tutor", 1);
try t.stable(700, 15000);
@@ -446,6 +487,15 @@ fn topbarexec(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.start(21, 90, &.{ "-n", "3" });
try t.wait(8000, "zmarkfile.txt");
try t.stable(700, 20000);
+ // Debug left the window row (UX K'4): typed into its own text, after its
+ // words (A appends at the line's end), and run there by B2
+ 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.settle(100);
+ try t.stable(400, 8000);
// sweep `zmarkfile.txt` out of the shell's own greeting: an ordinary left drag,
// and the kind of stale highlight that is simply lying around in real use
try t.press("left", "3", 6);
@@ -482,7 +532,7 @@ fn leader(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
// §4.5): the +Help index for a group is the word's, `Help h` swept here.
try t.file("cmds.txt", "Help Help h Help t Help c Help l");
try t.start(41, 100, &.{"cmds.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "cmds.txt");
try t.stable(700, 20000);
@@ -510,11 +560,11 @@ fn leader(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.stable(400, 5000);
// Executing Help as text opens the full index, not a filtered group.
- try t.press("middle", "@Help", 4);
- try t.release("middle", "@Help", 4);
+ try t.press("middle", "@Help", 3);
+ try t.release("middle", "@Help", 3);
try t.wait(10000, "pardes builtins: each one's keys and its name");
try t.wait(10000, "ClipPasteBefore");
- try sweepHelp(&t, "@Help#2", 4);
+ try sweepHelp(&t, "@Help#2", 3);
try t.wait(10000, "under SPC h");
try t.stable(700, 15000);
try t.snap("help-group");
@@ -534,24 +584,24 @@ fn leader(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.key("space d");
try t.stable(700, 15000);
- try t.press("middle", "@Help", 4);
- try t.release("middle", "@Help", 4);
+ try t.press("middle", "@Help", 3);
+ try t.release("middle", "@Help", 3);
try t.wait(10000, "pardes builtins: each one's keys and its name");
try t.wait(10000, "ClipPasteBefore");
// PDF commands depend on the build; these toggles do not.
- try sweepHelp(&t, "@Help#3", 4);
+ try sweepHelp(&t, "@Help#3", 3);
try t.wait(10000, "under SPC t");
// its first rows: each word's documentation under it, the rest below
try t.wait(10000, "SPC t a Ascii");
try t.wait(10000, "SPC t c Changes");
// SPC w is Window itself now, not a group; the column group stands in
- try sweepHelp(&t, "@Help#4", 4);
+ try sweepHelp(&t, "@Help#4", 3);
try t.wait(10000, "under SPC c");
try t.wait(10000, "Joincol");
try t.stable(700, 15000);
try t.snap("help-column");
- try sweepHelp(&t, "@Help#5", 4);
+ try sweepHelp(&t, "@Help#5", 3);
try t.wait(10000, "WsDiagnostics");
try t.stable(700, 15000);
try t.snap("help-language");
@@ -579,8 +629,8 @@ fn mini(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.start(23, 90, &.{"commands.txt"});
try t.wait(8000, "Mini demo.zig");
try t.stable(400, 10000);
- try t.press("middle", "@Mini", 4);
- try t.release("middle", "@Mini", 4);
+ try t.press("middle", "@Mini", 3);
+ try t.release("middle", "@Mini", 3);
try t.wait(8000, "/Mini demo.zig");
try t.stable(500, 10000);
try t.snap("opened");
@@ -754,7 +804,7 @@ fn msg(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
defer t.deinit();
try t.lines("a.txt", 6, "");
try t.start(15, 70, &.{"a.txt"});
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.wait(8000, "a.txt");
try t.stable(700, 20000);
try t.snap("opened");
@@ -885,7 +935,7 @@ fn savepane(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
var t = try Tty.init(gpa, exe, "savepane");
defer t.deinit();
try t.start(31, 100, &.{ "-n", "1" });
- try t.wait(8000, "Newcol Joincol");
+ try t.wait(8000, "Newcol Help Exit");
try t.stable(700, 20000);
// a scratch of our own, with something in it to save
try t.key("space f n");
@@ -944,26 +994,26 @@ fn filewatch(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.wait(8000, "w.txt");
try t.stable(700, 20000);
// open w.txt as a file pane: type the name into the shell, right-click it
- try t.press("left", "5", 9);
- try t.release("left", "5", 9);
+ try t.press("left", "5", 8);
+ try t.release("left", "5", 8);
try t.stable(400, 5000);
try t.key("i");
try t.send("w.txt");
try t.key("esc");
try t.settle(100);
- try t.press("right", "6", 9);
- try t.release("right", "6", 9);
+ try t.press("right", "6", 8);
+ try t.release("right", "6", 8);
try t.wait(10000, "line 4");
try t.stable(700, 15000);
// ...and open sub/s.txt from the path sitting on line 3 of that pane, so the
// second watched pane is in a DIFFERENT directory from the first
- try t.press("right", "20", 10);
- try t.release("right", "20", 10);
+ try t.press("right", "20", 9);
+ try t.release("right", "20", 9);
try t.wait(10000, "line 8");
try t.stable(700, 15000);
// an UNSAVED edit on line 1 of w.txt
- try t.press("left", "10", 8);
- try t.release("left", "10", 8);
+ try t.press("left", "10", 7);
+ try t.release("left", "10", 7);
try t.stable(400, 5000);
try t.key("i");
try t.send("MYEDIT");