From 094b562b5b90558e82a9c3e2beea386d93bd1803 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 8 Nov 2026 23:21:47 -0300 Subject: tests: the boot, argv and builtins snapshot scripts (22: argv badutf boot builtins dump load restore headersweep headersweep-restored logquiet tutor topbarexec leader mini ninep nested nested-optout shellset msg winch savepane filewatch) are process cases, test/process/tty_boot.zig, each its script's steps as Tty calls and its golden unchanged as its expectation; checked against the old runner by two breaks, the message stamp's spacing (3 fail in both) and the tty reading a middle press as a right one (the same 9 in both) Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/process/tty_boot.zig | 992 ++++++++++++++++++++++++++++++- test/snapshots/argv.snap | 34 -- test/snapshots/badutf.snap | 24 - test/snapshots/boot.snap | 8 - test/snapshots/builtins.snap | 87 --- test/snapshots/dump.snap | 22 - test/snapshots/filewatch.snap | 66 -- test/snapshots/headersweep-restored.snap | 44 -- test/snapshots/headersweep.snap | 70 --- test/snapshots/leader.snap | 70 --- test/snapshots/load.snap | 26 - test/snapshots/logquiet.snap | 16 - test/snapshots/mini.snap | 16 - test/snapshots/msg.snap | 103 ---- test/snapshots/nested-optout.snap | 24 - test/snapshots/nested.snap | 27 - test/snapshots/ninep.snap | 21 - test/snapshots/restore.snap | 25 - test/snapshots/savepane.snap | 33 - test/snapshots/shellset.snap | 45 -- test/snapshots/topbarexec.snap | 45 -- test/snapshots/tutor.snap | 8 - test/snapshots/winch.snap | 19 - 23 files changed, 991 insertions(+), 834 deletions(-) delete mode 100644 test/snapshots/argv.snap delete mode 100644 test/snapshots/badutf.snap delete mode 100644 test/snapshots/boot.snap delete mode 100644 test/snapshots/builtins.snap delete mode 100644 test/snapshots/dump.snap delete mode 100644 test/snapshots/filewatch.snap delete mode 100644 test/snapshots/headersweep-restored.snap delete mode 100644 test/snapshots/headersweep.snap delete mode 100644 test/snapshots/leader.snap delete mode 100644 test/snapshots/load.snap delete mode 100644 test/snapshots/logquiet.snap delete mode 100644 test/snapshots/mini.snap delete mode 100644 test/snapshots/msg.snap delete mode 100644 test/snapshots/nested-optout.snap delete mode 100644 test/snapshots/nested.snap delete mode 100644 test/snapshots/ninep.snap delete mode 100644 test/snapshots/restore.snap delete mode 100644 test/snapshots/savepane.snap delete mode 100644 test/snapshots/shellset.snap delete mode 100644 test/snapshots/topbarexec.snap delete mode 100644 test/snapshots/tutor.snap delete mode 100644 test/snapshots/winch.snap diff --git a/test/process/tty_boot.zig b/test/process/tty_boot.zig index 79413cbf..1d49dc8e 100644 --- a/test/process/tty_boot.zig +++ b/test/process/tty_boot.zig @@ -1,3 +1,993 @@ //! The tty frontend's own cases (test/tty.zig), starting: argv, the flags, the topbar's builtins, dumps and loads. +const std = @import("std"); +const Tty = @import("../tty.zig").Tty; -pub const cases = .{}; +pub const cases = .{ + .{ "tty boot: argv", argv }, + .{ "tty boot: badutf", badutf }, + .{ "tty boot: boot", boot }, + .{ "tty boot: builtins", builtins }, + .{ "tty boot: dump", dump }, + .{ "tty boot: load", load }, + .{ "tty boot: restore", restore }, + .{ "tty boot: headersweep", headersweep }, + .{ "tty boot: headersweep-restored", headersweep_restored }, + .{ "tty boot: logquiet", logquiet }, + .{ "tty boot: tutor", tutor }, + .{ "tty boot: topbarexec", topbarexec }, + .{ "tty boot: leader", leader }, + .{ "tty boot: mini", mini }, + .{ "tty boot: ninep", ninep }, + .{ "tty boot: nested", nested }, + .{ "tty boot: nested-optout", nested_optout }, + .{ "tty boot: shellset", shellset }, + .{ "tty boot: msg", msg }, + .{ "tty boot: winch", winch }, + .{ "tty boot: savepane", savepane }, + .{ "tty boot: filewatch", filewatch }, +}; + +// argv: bare `pardes` boots one shell already in tty mode; a FILE argument +// opens it ALONE, filling the window (file:LINE scrolls there) — naming a file +// is asking to read it, not to be handed a shell beside it; a DIRECTORY +// argument becomes the cwd the shell spawns in +fn argv(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "argv"); + defer t.deinit(); + try t.lines("notes.txt", 8, ""); + try t.file("zmarker.txt", "x"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("echo ARGV''TTY"); + try t.key("enter"); + try t.wait(8000, "ARGVTTY"); + 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, "line 3"); + try t.stable(700, 20000); + try t.snap("filearg"); + // -n and a FILE are not a combination: the file names the whole boot layout, so + // `-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, "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, "inside.txt"); + try t.stable(700, 20000); + try t.snap("dirarg"); + try t.done(); +} + +// Invalid UTF-8 must RENDER, never panic. Two sources, both ordinary use: +// a file pane holds whatever bytes are on disk (latin-1, a truncated sequence, +// an ELF opened by mistake). Undecodable bytes come out as U+FFFD, while +// horizontal scrolling must start at a complete grapheme boundary. +fn badutf(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "badutf"); + defer t.deinit(); + 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.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.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 + // first visible CJK glyph intact instead of starting inside its UTF-8 bytes. + try t.key("space t w"); + try t.stable(400, 5000); + try t.key("g l"); + try t.stable(700, 10000); + try t.snap("hscroll-midglyph"); + try t.done(); +} + +// -n 1: one shell pane in normal mode, greets with ls; prompts hidden +fn boot(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "boot"); + 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, "hello.txt"); + try t.stable(700, 20000); + try t.snap("boot"); + try t.style("boot"); + try t.done(); +} + +fn builtins(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "builtins"); + defer t.deinit(); + try t.lines("notes.txt", 6, ""); + try t.start(67, 120, &.{"notes.txt"}); + try t.wait(8000, "notes.txt"); + try t.stable(700, 20000); + try t.snap("boot"); + + // The full index includes commands without leader paths. + try t.key("space ?"); + try t.wait(10000, "pardes builtins, and how to run each:"); + try t.wait(10000, "ClipPasteBefore"); + try t.key("g e"); + // Every builtin added since adds an index line, and one wheel tick is one row + // (config.wheel_rows): scroll far enough to expose Look and Exec above the + // bottom viewport while keeping the same pane geometry for the later clicks. + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wheel("up", "110", 50); + try t.wait(10000, "Look enter, right-click"); + try t.wait(10000, "Exec tab, middle-click"); + try t.wait(10000, "Filter"); + try t.wait(10000, "Theme"); + try t.stable(700, 15000); + + // n moves through look-able text; it must not execute command names. + try t.key("space j n space j n space j n"); + try t.wait(10000, "Look enter, right-click"); + try t.wait(10000, "Exec tab, middle-click"); + try t.key("space c ?"); + try t.wait(10000, "under SPC c"); + try t.wait(10000, "Joincol"); + try t.stable(700, 15000); + try t.snap("column-group"); + + try t.key("space h ?"); + try t.wait(10000, "Tutor"); + try t.stable(700, 15000); + try t.snap("docs-group"); + try t.press("middle", "@Tutor", 16); + try t.release("middle", "@Tutor", 16); + try t.wait(10000, "PARDES TUTOR"); + try t.stable(700, 15000); + try t.snap("tutor-from-index"); + try t.done(); +} + +// Dump writes the whole session to this fixture's $DUMP path, a dump of the +// walk (src/walk.zig), and `-l` of it is that session again: the text typed +// into a terminal over its history comes back where it was. +fn dump(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "dump"); + defer t.deinit(); + try t.file("d.txt", "x"); + try t.start(31, 100, &.{ "-n", "3" }); + try t.wait(8000, "d.txt"); + try t.stable(700, 20000); + try t.press("left", "5", 10); + try t.release("left", "5", 10); + try t.stable(400, 5000); + try t.key("i"); + try t.send("typed-marker"); + try t.key("esc"); + try t.settle(100); + try t.stable(400, 5000); + try t.press("middle", "@Dump", 1); + try t.release("middle", "@Dump", 1); + try t.stable(600, 8000); + try t.start(31, 100, &.{ "-l", t.dump }); + try t.wait(8000, "typed-marker"); + try t.stable(700, 20000); + try t.snap("loaded"); + try t.done(); +} + +// pardes -l loads another instance's dump: the session as it was dumped, each +// terminal's view where it was (scrolled back into the seq output), its +// history above a "restored history" banner and a new shell below it. +fn load(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "load"); + defer t.deinit(); + try t.file("d.txt", "x"); + try t.start(31, 100, &.{ "-n", "3" }); + try t.wait(8000, "d.txt"); + try t.stable(700, 20000); + try t.key("c-b"); + try t.stable(600, 8000); + try t.send("echo LOAD''MARK; seq 1 40; echo E''ND"); + try t.key("enter"); + try t.wait(8000, "END"); + try t.stable(700, 10000); + try t.key("c-b"); + try t.stable(600, 8000); + try t.wheel("up", "10", 8); + try t.wheel("up", "10", 8); + try t.stable(500, 8000); + try t.press("middle", "@Dump", 1); + try t.release("middle", "@Dump", 1); + try t.stable(600, 8000); + try t.start(31, 100, &.{ "-l", t.dump }); + try t.wait(8000, "restored"); + try t.stable(700, 20000); + try t.snap("loaded"); + try t.style("loaded"); + try t.done(); +} + +// Dump writes to the resolved dump path ($PARDES_DUMP here; a timestamped file +// under ~/.local/share/pardes in live runs) and the topbar grows Restore ; +// middle-click Restore loads that dump back into the live session: output on +// screen at Dump time survives (pty history), later output does not +fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "restore"); + defer t.deinit(); + try t.start(31, 100, &.{ "-n", "1" }); + try t.wait(8000, "Newcol Joincol"); + try t.stable(700, 20000); + try t.key("c-b"); + try t.stable(600, 8000); + try t.send("echo KEEP''ME"); + try t.key("enter"); + try t.wait(8000, "KEEPME"); + try t.stable(700, 10000); + try t.press("middle", "@Dump", 1); + try t.release("middle", "@Dump", 1); + try t.stable(700, 10000); + try t.snap("dumped"); + try t.send("echo GONE''SOON"); + try t.key("enter"); + try t.wait(8000, "GONESOON"); + try t.stable(700, 10000); + try t.press("middle", "@Restore", 1); + try t.release("middle", "@Restore", 1); + try t.stable(900, 15000); + try t.snap("restored"); + try t.done(); +} + +// A middle sweep over a column's tag or the workspace's runs what it swept, +// as it does over a pane's tag: highlighted while the button is held, run +// when it comes up. Both headers used to run the word under the PRESS, on +// the press, so a sweep of `echo SWEPT-COL` ran a bare `echo`. A right sweep +// looks for what it swept the same way, and the other button cancels. +fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "headersweep"); + defer t.deinit(); + try t.file("hay.txt", "ZQNEEDLE"); + try t.start(21, 120, &.{ "-n", "3" }); + try t.wait(8000, "Newcol"); + try t.stable(700, 20000); + // the column tag: type a command onto it, then sweep the whole command + try t.press("left", "50", 2); + try t.release("left", "50", 2); + try t.key("i"); + try t.key("space"); + try t.send("echo SW''EPT-COL"); + try t.key("esc"); + try t.settle(100); + try t.press("middle", "@echo", 2); + try t.drag("middle", "@echo+8", 2); + try t.stable(300, 5000); + try t.style("col-sweeping"); + try t.drag("middle", "@echo+16", 2); + try t.release("middle", "@echo+16", 2); + try t.wait(8000, "SWEPT-COL"); + 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"); + try t.key("space"); + try t.send("echo SW''EPT-WS"); + try t.key("esc"); + try t.settle(100); + try t.press("middle", "@echo", 1); + try t.drag("middle", "@echo+15", 1); + try t.release("middle", "@echo+15", 1); + try t.wait(8000, "SWEPT-WS"); + try t.stable(700, 15000); + 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.key("space"); + try t.send("xxhay.txtxx"); + try t.key("esc"); + try t.settle(100); + try t.press("right", "@xxhay.txtxx+2", 1); + try t.drag("right", "@xxhay.txtxx+9", 1); + try t.release("right", "@xxhay.txtxx+9", 1); + try t.wait(8000, "ZQNEEDLE"); + try t.stable(700, 15000); + try t.snap("ws-looked"); + // the look button tapped during a middle sweep cancels it: nothing runs + try t.press("middle", "@echo", 2); + try t.drag("middle", "@echo+16", 2); + try t.press("right", "@echo+16", 2); + try t.release("right", "@echo+16", 2); + try t.release("middle", "@echo+16", 2); + try t.stable(700, 15000); + 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.stable(700, 15000); + try t.style("selected"); + try t.done(); +} + +// headersweep.snap in a session restored from a dump: its column and +// workspace tags are rebuilt, and a middle sweep over each runs what it +// swept, as it does in a fresh session. +fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "headersweep-restored"); + defer t.deinit(); + try t.start(21, 120, &.{ "-n", "3" }); + try t.wait(8000, "Newcol"); + try t.stable(700, 20000); + try t.press("middle", "@Dump", 1); + try t.release("middle", "@Dump", 1); + try t.stable(700, 10000); + try t.press("middle", "@Restore", 1); + try t.release("middle", "@Restore", 1); + try t.stable(900, 15000); + try t.press("left", "50", 2); + try t.release("left", "50", 2); + try t.key("i"); + try t.key("space"); + try t.send("echo RE''STORED-COL"); + try t.key("esc"); + try t.settle(100); + try t.press("middle", "@echo", 2); + try t.drag("middle", "@echo+8", 2); + try t.stable(300, 5000); + try t.style("col-sweeping"); + try t.drag("middle", "@echo+19", 2); + try t.release("middle", "@echo+19", 2); + try t.wait(8000, "RESTORED-COL"); + 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.key("space"); + try t.send("echo RE''STORED-WS"); + try t.key("esc"); + try t.settle(100); + try t.press("middle", "@echo", 1); + try t.drag("middle", "@echo+8", 1); + try t.stable(300, 5000); + try t.style("ws-sweeping"); + try t.drag("middle", "@echo+18", 1); + try t.release("middle", "@echo+18", 1); + try t.wait(8000, "RESTORED-WS"); + try t.stable(700, 15000); + try t.snap("ws-swept"); + try t.done(); +} + +// ghostty-vt narrates every sequence it does not implement through std.log, +// and a pardes child's stderr is this pty — so a library log line lands on the +// rendered grid, exactly where it does on a real user's terminal. The two +// sequences below are the cheapest ones that trip it: a kitty graphics query +// (`debug(kitty_gfx): executing kitty graphics command`) and a private CSI p +// (`warning(stream): ignoring unimplemented CSI p with intermediates: >`). +// The golden is the assertion that neither reaches the screen. +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.stable(700, 20000); + try t.key("c-b"); + try t.stable(600, 8000); + try t.send("printf '\\033_Ga=q,i=1,s=1,v=1,f=24,t=d;AAAA\\033\\\\\\033[>0p'"); + try t.key("enter"); + try t.stable(700, 20000); + try t.snap("quiet"); + try t.done(); +} + +// topbar middle-click Tutor opens the embedded tutor below its source shell +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.stable(700, 20000); + try t.press("middle", "@Tutor", 1); + try t.release("middle", "@Tutor", 1); + try t.stable(700, 15000); + try t.snap("tutor"); + try t.done(); +} + +// A topbar word runs on a middle click, and it runs WITH whatever is selected: +// sweep a word, click Grep, it greps that word. That is acme's 2-1 chord with +// no drag to chord into, and it is the whole reason the topbar reads the +// selection at all. +// +// But a selection is only an argument to a builtin that has somewhere to put +// one. `Exit`, `Debug`, `NextColor` and the rest match their name WHOLE — that +// is what makes `Exit foo` a shell command and not Exit — so splicing a sweep +// onto them produced a name matching no builtin, which fell out of the builtin +// parser and into a SHELL, as a command nobody typed (`bash: Debug: command +// not found`). It only ever bit you with a terminal open, because that is +// where the stray text went. +// +// So both halves are pinned here, against the same live selection: the no-arg +// builtin runs, and the arg-taking one still gets the word. +fn topbarexec(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "topbarexec"); + defer t.deinit(); + try t.file("zmarkfile.txt", "hay ZQNEEDLE stack"); + try t.start(21, 90, &.{ "-n", "3" }); + try t.wait(8000, "zmarkfile.txt"); + try t.stable(700, 20000); + // 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); + try t.drag("left", "15", 6); + try t.release("left", "15", 6); + try t.stable(700, 15000); + try t.snap("selected"); + // Debug takes NO argument. Middle-clicked with that sweep live it must open the + // overlay — not send `Debug zmarkfile.txt` to bash. The box IS the assertion. + try t.press("middle", "@Debug", 1); + try t.release("middle", "@Debug", 1); + try t.stable(700, 15000); + try t.snap("noarg-runs"); + // ...and off again, so the overlay does not cover what comes next + try t.press("middle", "@Debug", 1); + try t.release("middle", "@Debug", 1); + try t.stable(700, 15000); + // Find DOES take one, and still gets it: the sweep is the pattern, so the + // results buffer names the file it matched. An empty buffer would mean Find + // ran with no argument (which arms the prompt instead), so the ROW is the + // assertion — the splice is what put it there. + try t.press("middle", "@Find", 1); + try t.release("middle", "@Find", 1); + try t.wait(10000, "+Search"); + try t.stable(700, 15000); + try t.snap("arg-still-spliced"); + try t.done(); +} + +fn leader(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "leader"); + defer t.deinit(); + try t.file("cmds.txt", "Help"); + try t.start(41, 100, &.{"cmds.txt"}); + try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "cmds.txt"); + try t.stable(700, 20000); + + try t.key("space"); + try t.stable(400, 5000); + try t.snap("spc"); + try t.key("h"); + try t.stable(400, 5000); + try t.snap("spc-h"); + try t.key("esc"); + try t.settle(100); + try t.stable(400, 5000); + try t.snap("abandoned"); + try t.key("space x"); + try t.stable(400, 5000); + try t.snap("unmapped"); + + // 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.wait(10000, "pardes builtins, and how to run each:"); + try t.wait(10000, "ClipPasteBefore"); + try t.key("space h ?"); + try t.wait(10000, "under SPC h"); + try t.stable(700, 15000); + try t.snap("help-group"); + + try t.key("space h t"); + try t.wait(10000, "PARDES TUTOR"); + try t.stable(700, 15000); + try t.snap("tutor"); + // the tutor is at the foot of its column (acme's placement put it under the + // +Help's text), so SPC d has nothing to ask and closes it at once + try t.key("space d"); + try t.stable(700, 15000); + try t.snap("deleted"); + // ...and the +Help it squeezed goes too, so the full index below opens with + // room to show it + try t.key("c-w j enter"); + try t.key("space d"); + try t.stable(700, 15000); + + try t.key("space ?"); + try t.wait(10000, "pardes builtins, and how to run each:"); + try t.wait(10000, "ClipPasteBefore"); + + // PDF commands depend on the build; these toggles do not. + try t.key("space t ?"); + try t.wait(10000, "under SPC t"); + try t.wait(10000, "Ascii"); + try t.wait(10000, "Palette"); + try t.wait(10000, "Petscii"); + try t.wait(10000, "Wrap"); + // SPC w is Window itself now, not a group; the column group stands in + try t.key("space c ?"); + try t.wait(10000, "under SPC c"); + try t.wait(10000, "Joincol"); + try t.stable(700, 15000); + try t.snap("help-column"); + try t.key("space l ?"); + try t.wait(10000, "WsDiagnostics"); + try t.stable(700, 15000); + try t.snap("help-language"); + try t.key("space d"); + try t.settle(100); + try t.stable(700, 15000); + try t.snap("del-output"); + try t.done(); +} + +fn mini(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "mini"); + defer t.deinit(); + try t.file("commands.txt", "@`Mini demo.zig`"); + try t.file("demo.zig", "const greeting = \"café λ 界 é\";\n\npub fn choose(ok: bool) u32 {\n if (ok) return 42;\n return 7;\n}\n\n// space and color survive compression\nconst answer = choose(true);\n"); + 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.wait(8000, "/Mini demo.zig"); + try t.stable(500, 10000); + try t.snap("opened"); + try t.style("opened"); + try t.snap9p("opened"); + try t.resize(27, 105); + try t.stable(400, 10000); + try t.snap("resized"); + try t.snap9p("resized"); + try t.done(); +} + +fn ninep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "ninep"); + defer t.deinit(); + try t.file("demo.zig", "const greeting = \"café λ 界 é\";\n\npub fn choose(ok: bool) u32 {\n if (ok) return 42;\n return 7;\n}\n"); + try t.start(15, 90, &.{"demo.zig"}); + try t.wait(8000, "choose"); + try t.stable(400, 10000); + try t.snap("opened"); + try t.style("opened"); + try t.snap9p("opened"); + try t.key("g g i"); + try t.send("// café λ 界\n"); + try t.key("esc"); + try t.settle(100); + try t.stable(300, 8000); + try t.snap("edited"); + try t.snap9p("edited"); + try t.style("edited"); + try t.resize(20, 105); + try t.stable(400, 10000); + try t.style("resized"); + try t.snap9p("resized"); + try t.snap("resized"); + try t.snap9p("unchanged"); + try t.done(); +} + +fn nested(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "nested"); + defer t.deinit(); + try t.dir("nestdir"); + try t.file("nestdir/inside-nested.txt", "marker"); + try t.file("nested.txt", "hello-from-nested\nsecond-nested-line\n"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("$(readlink /proc/$PPID/exe) nested.txt"); + try t.key("enter"); + try t.wait(15000, "hello-from-nested"); + try t.stable(700, 20000); + try t.snap("file-arg"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("$(readlink /proc/$PPID/exe)"); + try t.key("enter"); + try t.wait(15000, "already inside pardes"); + try t.stable(700, 20000); + try t.snap("no-arg"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("$(readlink /proc/$PPID/exe) nestdir"); + try t.key("enter"); + try t.wait(15000, "inside-nested.txt"); + try t.stable(700, 20000); + try t.snap("dir-arg"); + try t.done(); +} + +fn nested_optout(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "nested-optout"); + defer t.deinit(); + try t.file("nested.txt", "optout-marker\nsecond-optout-line\n"); + try t.dir("innerdir"); + try t.file("innerdir/deeper.txt", "deepest-marker\n"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("$(readlink /proc/$PPID/exe) --nested nested.txt"); + try t.key("enter"); + try t.wait(20000, "optout-marker"); + try t.stable(700, 20000); + try t.snap("optout-file"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("(cd innerdir && $(readlink /proc/$PPID/exe) --nested)"); + try t.key("enter"); + try t.wait(20000, "cwd/innerdir"); + try t.stable(700, 20000); + try t.snap("inner-shell"); + try t.send("$(readlink /proc/$PPID/exe) deeper.txt"); + try t.key("enter"); + try t.wait(20000, "deepest-marker"); + try t.stable(700, 20000); + try t.snap("inner-launch"); + try t.done(); +} + +// The Shell builtin names the binary the NEXT terminal execs. What is pinned +// here is the case that has to hold on a machine you did not set up: the name +// resolves to nothing, so Shell refuses it and says why on the message row, +// and the next pane opens anyway with the shell that was set before. +// +// A default $SHELL that names nothing executable falls back to /bin/sh +// (config.defaultShell), and the host's lookup still falls back at spawn for +// a shell that went away after it was set: a pane never gets a child that +// dies at exec and shows one EOF. +// +// The rest of the feature is unit-tested rather than pinned here, on purpose. +// Which family a binary belongs to, what argv each one gets and where the +// lookup searches are in host_io.Shell's own tests; the fish end of it cannot +// be a golden at all, because fish's prompt carries a hostname and its greeting +// a version number. (Every script in this suite runs bash, pinned through an +// ordinary config file the harness writes — see snapshot.zig.) +fn shellset(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "shellset"); + defer t.deinit(); + try t.file("cmd.txt", "Shell zznosuchshell"); + try t.file("zmarkfile.txt", "x"); + try t.start(21, 90, &.{"cmd.txt"}); + try t.wait(8000, "Shell zznosuchshell"); + try t.stable(700, 20000); + try t.snap("boot"); + // execute the line the way you would run any command: select it, Tab. Nothing + // on any machine is installed under that name, so the resolver runs out of + // directories. (A file pane, so the line executed is the line you can see — + // typing into a terminal's overlay would leave `gg`/`x` selecting its output.) + try t.key("g g"); + try t.key("x"); + try t.stable(400, 5000); + try t.key("tab"); + try t.stable(700, 15000); + // NOTHING happened on screen, and that is the assertion: a name the builtin + // parser does not know is a command line, so it would have forked a terminal + // for this directory and printed `Shell: command not found` into it. One + // pane, no error — `Shell` was consumed as a builtin and its argument went + // with it. + try t.snap("builtin-ran"); + // a new terminal, which asks for a shell that is not there. It gets the + // fallback: the pane greets, `ls` runs, and its output is on screen. Alt-n and + // Alt-c, because `New`/`Newcol` open an empty +New scratch rather than a shell. + try t.key("a-n"); + try t.key("a-c"); + try t.wait(15000, "zmarkfile.txt"); + try t.stable(700, 20000); + try t.snap("fallback-shell"); + try t.done(); +} + +// The transient message row: the LAST row of a pane, left-aligned at the text +// area's origin, saying what just happened to that pane and when. An OVERLAY, +// not geometry — nothing shrinks to make room, so a pane with nothing to say is +// not touched at all, which is why the other 71 goldens only moved where a +// prompt or a message actually appears. +// +// The clock reads `--:--:--` here and only here: $PARDES_NOTIME (set by +// snapshot.zig, the same flag that hides the language backend's durations) +// blanks the DIGITS rather than the row, because a message that disappeared +// under the harness could not be pinned at all. +// +// The row has exactly two possible occupants and they are not the same kind of +// thing. A MESSAGE is a report of something that already happened, and the next +// key or mouse event wipes it. An armed PROMPT is what that keystroke is being +// typed INTO, it lives until Enter or Esc, and it WINS. +fn msg(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "msg"); + 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, "a.txt"); + try t.stable(700, 20000); + try t.snap("opened"); + // Save (SPC f s) writes the file; the SHELL is where the write and the clock + // both are, so the shell is what posts the message once the bytes are down. + try t.key("space f s"); + try t.stable(700, 15000); + try t.snap("saved"); + // A REPAINT is not input. A resize redraws every cell in the window from + // scratch and the message is still there on the other side of it — the row is + // state, not one frame's flash. (Different rows, or the kernel sends no + // SIGWINCH and nothing repaints.) + try t.resize(17, 70); + try t.stable(700, 15000); + try t.snap("repainted"); + // ...but the next KEY takes it away. `j` is a plain cursor motion and changes + // nothing else on screen, so the vanishing message is the whole diff. + try t.key("j"); + try t.stable(700, 15000); + try t.snap("keycleared"); + // Again, and this time a bare mouse MOTION — no button, nothing clicked — + // clears it: any mouse event counts, the rule is "you are back", not "you did + // something". + try t.key("space f s"); + try t.stable(700, 15000); + try t.snap("saved-again"); + try t.motion("20", 6); + try t.stable(700, 15000); + try t.snap("mousecleared"); + // The other message: an external write lands in the pane (filewatch.snap owns + // that contract) and the row says which of the two things happened. `run` is a + // child of the RUNNER, so the app receives no keystroke here and nothing but + // the watch could have posted this. + try t.run("printf 'EXTERNAL\\n' > a.txt"); + try t.wait(10000, "EXTERNAL"); + try t.stable(700, 15000); + try t.snap("reloaded"); + // `/` still types into the tag tail — same buffer, same offsets, same one-line + // editor, same Enter and Esc — but it is DRAWN here now, so the tagline keeps + // its builtins instead of losing them to a long pattern. Note the tag row above + // ends at `Del`: the marker and the pattern are no longer on it at all. (The + // `/` keystroke also cleared the reload message, which is the rule above.) + try t.key("s"); + try t.send("EXT"); + try t.stable(700, 15000); + try t.snap("prompt"); + // ...and a message arriving UNDER an armed prompt does not disturb it: a second + // external write reloads the pane and posts one, the row stays the prompt's. + try t.run("printf 'AGAIN\\n' > a.txt"); + try t.wait(10000, "AGAIN"); + try t.stable(700, 15000); + try t.snap("prompt-wins"); + // Esc abandons the input, and the very key that abandoned it is also the key + // that clears the message queued underneath — so the row goes empty rather than + // handing back a report from before you started typing. + try t.key("esc"); + try t.settle(100); + try t.stable(700, 15000); + try t.snap("esc"); + // Every other writer of this row is something going WRONG, which is a poor way + // to look at a row: `Msg ` is the word that writes it on purpose. An + // ordinary builtin, so it runs the ordinary way — write it in the buffer, + // select the line, execute it — and what lands is the text, verbatim, with the + // same stamped-looking left edge as the reports above. (The clock belongs to + // the SHELL, which is why this one has none: the core has no clock.) + try t.key("o"); + try t.send("Msg hand-written report"); + try t.key("esc"); + try t.settle(100); + try t.key("x"); + try t.key("tab"); + try t.stable(700, 15000); + try t.snap("msgbuiltin"); + // A message wider than the pane keeps its TAIL, not its head: the end of a + // message is the part that says something -- a path's file name, an error's + // reason -- so the head is what a narrow pane goes without. + try t.key("j"); + try t.key("o"); + try t.send("Msg 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 THE-END"); + try t.key("esc"); + try t.settle(100); + try t.key("x"); + try t.key("tab"); + try t.stable(700, 15000); + try t.snap("msgtail"); + try t.done(); +} + +// SIGWINCH crash (reported as "crash on font-size change"): resizing the outer +// terminal delivers SIGWINCH, and vaxis's default handler locks std.Io mutexes +// from signal context — landing on a thread inside an Io.Threaded syscall +// region (pty readers in read(2), main parked in queue.pop) panicked the Io +// machinery and killed pardes. Now every thread blocks SIGWINCH and a sigwait +// watcher consumes it. The in-pane kill storm below crashed pardes before the +// fix; the resize after proves the watcher still reflows the grid. +fn winch(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "winch"); + defer t.deinit(); + try t.start(31, 100, &.{ "-n", "3" }); + try t.stable(700, 20000); + try t.key("c-b"); + try t.stable(600, 8000); + try t.send("for i in $(seq 600); do kill -WINCH $PPID; done; echo SUR''VIVED"); + try t.key("enter"); + try t.wait(15000, "SURVIVED"); + try t.stable(700, 15000); + try t.snap("storm"); + try t.resize(35, 106); + try t.stable(700, 15000); + try t.snap("resized"); + try t.done(); +} + +// `Save` with NO argument on a +New scratch: the prompt is drawn in the tag, +// prefilled with the pane's own directory, and submitting it turns the scratch +// into an ordinary file pane whose bytes are on disk. +// +// config.zig's save_marker is rendered in no other golden in the suite. Ten +// unit tests assert the STRING startSavePrompt builds (pardes.zig's "Save on a +// scratch asks for a path in its inherited dir and makes it a file"); none of +// them can see it drawn, land on the tag rather than the message row, or show +// what the pane becomes afterwards. That is what this script is for. +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.stable(700, 20000); + // a scratch of our own, with something in it to save + try t.key("space f n"); + try t.stable(400, 5000); + try t.key("i"); + try t.send("scratch bytes"); + try t.key("esc"); + try t.settle(100); + try t.stable(400, 5000); + try t.snap("scratch"); + // Save, no argument: the tag gains the armed ` Save /` prompt, and the + // pane is still the scratch — nothing is written until the path is submitted + try t.key("space f s"); + try t.stable(400, 5000); + try t.snap("prompt"); + // name it: the prompt submits, the pane becomes that file (its tag is the path, + // and the `*` is gone because what is on screen is what is on disk) + try t.send("saved.txt"); + try t.key("enter"); + try t.stable(700, 15000); + try t.snap("saved"); + try t.snapFile("bytes", "saved.txt"); + try t.done(); +} + +// external file updates: a write from outside pardes lands in an open pane +// that has no unsaved edits, committed like any other edit; a pane WITH +// unsaved edits keeps them and says the file changed on disk (File.changed). +// +// The writer must be a STRANGER to the editor. This script used to have a +// pardes PANE run the write, which proved much less than it looked: that +// shell's own pty output wakes the loop and paints a frame, so the reload +// could be riding on the keystroke's frame instead of on the watch. `run` is a +// child of the RUNNER — nothing it does reaches an app pty — and every +// assertion below it is a `wait`, which only READS the pty. So between the +// write and the reload the app receives no keystroke, no resize, no mouse: if +// the watch does not wake the loop by itself, these waits time out. +// +// Two files in two directories, written the two ways files actually change: +// w.txt in place (CLOSE_WRITE) and sub/s.txt by rename-over, which is what +// `zig fmt`, `git checkout` and every editor's atomic save do (MOVED_TO, and +// a new inode — the reason the mark is on the directory). +fn filewatch(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "filewatch"); + defer t.deinit(); + try t.dir("sub"); + try t.file("w.txt", "line 1\nline 2\n/tmp/pardes-snap/filewatch/cwd/sub/s.txt\nline 4\nline 5\nline 6\nline 7\nline 8\nline 9\nline 10\nline 11\nline 12\n"); + try t.lines("sub/s.txt", 8, ""); + // Builtins announce themselves by default, and an announcement is a band at + // the top of the body -- which moves every row this script clicks. What the + // verbs do is what is under test, not the announcement. + try t.config("Verbose off"); + try t.start(31, 210, &.{ "-n", "1" }); + 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.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.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.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.stable(400, 5000); + try t.key("i"); + try t.send("MYEDIT"); + try t.key("esc"); + try t.settle(100); + try t.stable(400, 5000); + try t.snap("edited"); + // ---- from here to `snap reloaded_sub`, pardes is sent NOTHING ---- + // w.txt has the unsaved edit: it is kept, and the change is said + try t.run("printf 'EXTERNAL\\n' > w.txt"); + try t.wait(10000, "changed on disk"); + try t.stable(700, 10000); + try t.snap("kept"); + // sub/s.txt has none: it takes the new text + try t.run("printf 'RENAMED\\n' > sub/t && mv sub/t sub/s.txt"); + try t.wait(10000, "RENAMED"); + try t.stable(700, 10000); + try t.snap("reloaded_sub"); + try t.done(); +} diff --git a/test/snapshots/argv.snap b/test/snapshots/argv.snap deleted file mode 100644 index 892f6b24..00000000 --- a/test/snapshots/argv.snap +++ /dev/null @@ -1,34 +0,0 @@ -# argv: bare `pardes` boots one shell already in tty mode; a FILE argument -# opens it ALONE, filling the window (file:LINE scrolls there) — naming a file -# is asking to read it, not to be handed a shell beside it; a DIRECTORY -# argument becomes the cwd the shell spawns in -lines notes.txt 8 -file zmarker.txt x -start 31 100 -wait 8000 $ -stable 700 20000 -text echo ARGV''TTY -key enter -wait 8000 ARGVTTY -stable 700 10000 -snap noargs -start 31 100 notes.txt:3 -wait 8000 Newcol Joincol -wait 8000 line 3 -stable 700 20000 -snap filearg -# -n and a FILE are not a combination: the file names the whole boot layout, so -# `-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) -start 31 100 -n 3 notes.txt -wait 8000 Newcol Joincol -wait 8000 line 1 -stable 700 20000 -snap filearg-n3 -dirmk sub -file sub/inside.txt marker -start 31 100 sub -wait 8000 Newcol Joincol -wait 8000 inside.txt -stable 700 20000 -snap dirarg diff --git a/test/snapshots/badutf.snap b/test/snapshots/badutf.snap deleted file mode 100644 index 7171df00..00000000 --- a/test/snapshots/badutf.snap +++ /dev/null @@ -1,24 +0,0 @@ -# Invalid UTF-8 must RENDER, never panic. Two sources, both ordinary use: -# a file pane holds whatever bytes are on disk (latin-1, a truncated sequence, -# an ELF opened by mistake). Undecodable bytes come out as U+FFFD, while -# horizontal scrolling must start at a complete grapheme boundary. -file bad.txt hello \xff\xfe world\nlatin-1 caf\xe9 tail\ntruncated \xe6\x97 here\nend\n -file wide.txt \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e tail\nsecond line\n -start 31 100 bad.txt -wait 8000 Newcol Joincol -stable 700 20000 -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 -start 31 50 wide.txt -wait 8000 Newcol Joincol -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 -# first visible CJK glyph intact instead of starting inside its UTF-8 bytes. -key space t w -stable 400 5000 -key g l -stable 700 10000 -snap hscroll-midglyph diff --git a/test/snapshots/boot.snap b/test/snapshots/boot.snap deleted file mode 100644 index 60baf7de..00000000 --- a/test/snapshots/boot.snap +++ /dev/null @@ -1,8 +0,0 @@ -# -n 1: one shell pane in normal mode, greets with ls; prompts hidden -file hello.txt marker-content -start 31 100 -n 1 -wait 8000 Newcol Joincol -wait 8000 hello.txt -stable 700 20000 -snap boot -snapstyle boot diff --git a/test/snapshots/builtins.snap b/test/snapshots/builtins.snap deleted file mode 100644 index 14dd2bcf..00000000 --- a/test/snapshots/builtins.snap +++ /dev/null @@ -1,87 +0,0 @@ -lines notes.txt 6 -start 67 120 notes.txt -wait 8000 notes.txt -stable 700 20000 -snap boot - -# The full index includes commands without leader paths. -key space ? -wait 10000 pardes builtins, and how to run each: -wait 10000 ClipPasteBefore -key g e -# Every builtin added since adds an index line, and one wheel tick is one row -# (config.wheel_rows): scroll far enough to expose Look and Exec above the -# bottom viewport while keeping the same pane geometry for the later clicks. -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wheel up 110 50 -wait 10000 Look enter, right-click -wait 10000 Exec tab, middle-click -wait 10000 Filter -wait 10000 Theme -stable 700 15000 - -# n moves through look-able text; it must not execute command names. -key space j n space j n space j n -wait 10000 Look enter, right-click -wait 10000 Exec tab, middle-click -key space c ? -wait 10000 under SPC c -wait 10000 Joincol -stable 700 15000 -snap column-group - -key space h ? -wait 10000 Tutor -stable 700 15000 -snap docs-group -press middle @Tutor 16 -release middle @Tutor 16 -wait 10000 PARDES TUTOR -stable 700 15000 -snap tutor-from-index diff --git a/test/snapshots/dump.snap b/test/snapshots/dump.snap deleted file mode 100644 index 5a602304..00000000 --- a/test/snapshots/dump.snap +++ /dev/null @@ -1,22 +0,0 @@ -# Dump writes the whole session to this fixture's $DUMP path, a dump of the -# walk (src/walk.zig), and `-l` of it is that session again: the text typed -# into a terminal over its history comes back where it was. -file d.txt x -start 31 100 -n 3 -wait 8000 d.txt -stable 700 20000 -press left 5 10 -release left 5 10 -stable 400 5000 -key i -text typed-marker -key esc -settle 100 -stable 400 5000 -press middle @Dump 1 -release middle @Dump 1 -stable 600 8000 -start 31 100 -l $DUMP -wait 8000 typed-marker -stable 700 20000 -snap loaded diff --git a/test/snapshots/filewatch.snap b/test/snapshots/filewatch.snap deleted file mode 100644 index 6664519f..00000000 --- a/test/snapshots/filewatch.snap +++ /dev/null @@ -1,66 +0,0 @@ -# external file updates: a write from outside pardes lands in an open pane -# that has no unsaved edits, committed like any other edit; a pane WITH -# unsaved edits keeps them and says the file changed on disk (File.changed). -# -# The writer must be a STRANGER to the editor. This script used to have a -# pardes PANE run the write, which proved much less than it looked: that -# shell's own pty output wakes the loop and paints a frame, so the reload -# could be riding on the keystroke's frame instead of on the watch. `run` is a -# child of the RUNNER — nothing it does reaches an app pty — and every -# assertion below it is a `wait`, which only READS the pty. So between the -# write and the reload the app receives no keystroke, no resize, no mouse: if -# the watch does not wake the loop by itself, these waits time out. -# -# Two files in two directories, written the two ways files actually change: -# w.txt in place (CLOSE_WRITE) and sub/s.txt by rename-over, which is what -# `zig fmt`, `git checkout` and every editor's atomic save do (MOVED_TO, and -# a new inode — the reason the mark is on the directory). -dirmk sub -file w.txt line 1\nline 2\n/tmp/pardes-snap/filewatch/cwd/sub/s.txt\nline 4\nline 5\nline 6\nline 7\nline 8\nline 9\nline 10\nline 11\nline 12\n -lines sub/s.txt 8 -# Builtins announce themselves by default, and an announcement is a band at -# the top of the body -- which moves every row this script clicks. What the -# verbs do is what is under test, not the announcement. -config Verbose off -start 31 210 -n 1 -wait 8000 w.txt -stable 700 20000 -# open w.txt as a file pane: type the name into the shell, right-click it -press left 5 9 -release left 5 9 -stable 400 5000 -key i -text w.txt -key esc -settle 100 -press right 6 9 -release right 6 9 -wait 10000 line 4 -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 -press right 20 10 -release right 20 10 -wait 10000 line 8 -stable 700 15000 -# an UNSAVED edit on line 1 of w.txt -press left 10 8 -release left 10 8 -stable 400 5000 -key i -text MYEDIT -key esc -settle 100 -stable 400 5000 -snap edited -# ---- from here to `snap reloaded_sub`, pardes is sent NOTHING ---- -# w.txt has the unsaved edit: it is kept, and the change is said -run printf 'EXTERNAL\n' > w.txt -wait 10000 changed on disk -stable 700 10000 -snap kept -# sub/s.txt has none: it takes the new text -run printf 'RENAMED\n' > sub/t && mv sub/t sub/s.txt -wait 10000 RENAMED -stable 700 10000 -snap reloaded_sub diff --git a/test/snapshots/headersweep-restored.snap b/test/snapshots/headersweep-restored.snap deleted file mode 100644 index b0d51f6e..00000000 --- a/test/snapshots/headersweep-restored.snap +++ /dev/null @@ -1,44 +0,0 @@ -# headersweep.snap in a session restored from a dump: its column and -# workspace tags are rebuilt, and a middle sweep over each runs what it -# swept, as it does in a fresh session. -start 21 120 -n 3 -wait 8000 Newcol -stable 700 20000 -press middle @Dump 1 -release middle @Dump 1 -stable 700 10000 -press middle @Restore 1 -release middle @Restore 1 -stable 900 15000 -press left 50 2 -release left 50 2 -key i -key space -text echo RE''STORED-COL -key esc -settle 100 -press middle @echo 2 -drag middle @echo+8 2 -stable 300 5000 -snapstyle col-sweeping -drag middle @echo+19 2 -release middle @echo+19 2 -wait 8000 RESTORED-COL -stable 700 15000 -snap col-swept -press left 118 1 -release left 118 1 -key i -key space -text echo RE''STORED-WS -key esc -settle 100 -press middle @echo 1 -drag middle @echo+8 1 -stable 300 5000 -snapstyle ws-sweeping -drag middle @echo+18 1 -release middle @echo+18 1 -wait 8000 RESTORED-WS -stable 700 15000 -snap ws-swept diff --git a/test/snapshots/headersweep.snap b/test/snapshots/headersweep.snap deleted file mode 100644 index 68ee16b0..00000000 --- a/test/snapshots/headersweep.snap +++ /dev/null @@ -1,70 +0,0 @@ -# A middle sweep over a column's tag or the workspace's runs what it swept, -# as it does over a pane's tag: highlighted while the button is held, run -# when it comes up. Both headers used to run the word under the PRESS, on -# the press, so a sweep of `echo SWEPT-COL` ran a bare `echo`. A right sweep -# looks for what it swept the same way, and the other button cancels. -file hay.txt ZQNEEDLE -start 21 120 -n 3 -wait 8000 Newcol -stable 700 20000 -# the column tag: type a command onto it, then sweep the whole command -press left 50 2 -release left 50 2 -key i -key space -text echo SW''EPT-COL -key esc -settle 100 -press middle @echo 2 -drag middle @echo+8 2 -stable 300 5000 -snapstyle col-sweeping -drag middle @echo+16 2 -release middle @echo+16 2 -wait 8000 SWEPT-COL -stable 700 15000 -snap col-swept -# the workspace tag, the same -press left 110 1 -release left 110 1 -key i -key space -text echo SW''EPT-WS -key esc -settle 100 -press middle @echo 1 -drag middle @echo+15 1 -release middle @echo+15 1 -wait 8000 SWEPT-WS -stable 700 15000 -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` -press left 118 1 -release left 118 1 -key i -key space -text xxhay.txtxx -key esc -settle 100 -press right @xxhay.txtxx+2 1 -drag right @xxhay.txtxx+9 1 -release right @xxhay.txtxx+9 1 -wait 8000 ZQNEEDLE -stable 700 15000 -snap ws-looked -# the look button tapped during a middle sweep cancels it: nothing runs -press middle @echo 2 -drag middle @echo+16 2 -press right @echo+16 2 -release right @echo+16 2 -release middle @echo+16 2 -stable 700 15000 -snap cancelled -# for comparison, a select sweep over the second column's tag selects, in -# the tag's selection colours, and runs nothing -press left @Find#2 2 -drag left @Grep#2+4 2 -release left @Grep#2+4 2 -stable 700 15000 -snapstyle selected diff --git a/test/snapshots/leader.snap b/test/snapshots/leader.snap deleted file mode 100644 index f6068cba..00000000 --- a/test/snapshots/leader.snap +++ /dev/null @@ -1,70 +0,0 @@ -file cmds.txt Help -start 41 100 cmds.txt -wait 8000 Newcol Joincol -wait 8000 cmds.txt -stable 700 20000 - -key space -stable 400 5000 -snap spc -key h -stable 400 5000 -snap spc-h -key esc -settle 100 -stable 400 5000 -snap abandoned -key space x -stable 400 5000 -snap unmapped - -# Executing Help as text opens the full index, not a filtered group. -press middle @Help 4 -release middle @Help 4 -wait 10000 pardes builtins, and how to run each: -wait 10000 ClipPasteBefore -key space h ? -wait 10000 under SPC h -stable 700 15000 -snap help-group - -key space h t -wait 10000 PARDES TUTOR -stable 700 15000 -snap tutor -# the tutor is at the foot of its column (acme's placement put it under the -# +Help's text), so SPC d has nothing to ask and closes it at once -key space d -stable 700 15000 -snap deleted -# ...and the +Help it squeezed goes too, so the full index below opens with -# room to show it -key c-w j enter -key space d -stable 700 15000 - -key space ? -wait 10000 pardes builtins, and how to run each: -wait 10000 ClipPasteBefore - -# PDF commands depend on the build; these toggles do not. -key space t ? -wait 10000 under SPC t -wait 10000 Ascii -wait 10000 Palette -wait 10000 Petscii -wait 10000 Wrap -# SPC w is Window itself now, not a group; the column group stands in -key space c ? -wait 10000 under SPC c -wait 10000 Joincol -stable 700 15000 -snap help-column -key space l ? -wait 10000 WsDiagnostics -stable 700 15000 -snap help-language -key space d -settle 100 -stable 700 15000 -snap del-output diff --git a/test/snapshots/load.snap b/test/snapshots/load.snap deleted file mode 100644 index 75a9a341..00000000 --- a/test/snapshots/load.snap +++ /dev/null @@ -1,26 +0,0 @@ -# pardes -l loads another instance's dump: the session as it was dumped, each -# terminal's view where it was (scrolled back into the seq output), its -# history above a "restored history" banner and a new shell below it. -file d.txt x -start 31 100 -n 3 -wait 8000 d.txt -stable 700 20000 -key c-b -stable 600 8000 -text echo LOAD''MARK; seq 1 40; echo E''ND -key enter -wait 8000 END -stable 700 10000 -key c-b -stable 600 8000 -wheel up 10 8 -wheel up 10 8 -stable 500 8000 -press middle @Dump 1 -release middle @Dump 1 -stable 600 8000 -start 31 100 -l $DUMP -wait 8000 restored -stable 700 20000 -snap loaded -snapstyle loaded diff --git a/test/snapshots/logquiet.snap b/test/snapshots/logquiet.snap deleted file mode 100644 index fb3e2653..00000000 --- a/test/snapshots/logquiet.snap +++ /dev/null @@ -1,16 +0,0 @@ -# ghostty-vt narrates every sequence it does not implement through std.log, -# and a pardes child's stderr is this pty — so a library log line lands on the -# rendered grid, exactly where it does on a real user's terminal. The two -# sequences below are the cheapest ones that trip it: a kitty graphics query -# (`debug(kitty_gfx): executing kitty graphics command`) and a private CSI p -# (`warning(stream): ignoring unimplemented CSI p with intermediates: >`). -# The golden is the assertion that neither reaches the screen. -start 31 100 -n 1 -wait 8000 Newcol Joincol -stable 700 20000 -key c-b -stable 600 8000 -text printf '\033_Ga=q,i=1,s=1,v=1,f=24,t=d;AAAA\033\\\033[>0p' -key enter -stable 700 20000 -snap quiet diff --git a/test/snapshots/mini.snap b/test/snapshots/mini.snap deleted file mode 100644 index ca27c0c1..00000000 --- a/test/snapshots/mini.snap +++ /dev/null @@ -1,16 +0,0 @@ -file commands.txt @`Mini demo.zig` -file demo.zig const greeting = "café λ 界 é";\n\npub fn choose(ok: bool) u32 {\n if (ok) return 42;\n return 7;\n}\n\n// space and color survive compression\nconst answer = choose(true);\n -start 23 90 commands.txt -wait 8000 Mini demo.zig -stable 400 10000 -press middle @Mini 4 -release middle @Mini 4 -wait 8000 /Mini demo.zig -stable 500 10000 -snap opened -snapstyle opened -snap9p opened -resize 27 105 -stable 400 10000 -snap resized -snap9p resized diff --git a/test/snapshots/msg.snap b/test/snapshots/msg.snap deleted file mode 100644 index 64a77bb2..00000000 --- a/test/snapshots/msg.snap +++ /dev/null @@ -1,103 +0,0 @@ -# The transient message row: the LAST row of a pane, left-aligned at the text -# area's origin, saying what just happened to that pane and when. An OVERLAY, -# not geometry — nothing shrinks to make room, so a pane with nothing to say is -# not touched at all, which is why the other 71 goldens only moved where a -# prompt or a message actually appears. -# -# The clock reads `--:--:--` here and only here: $PARDES_NOTIME (set by -# snapshot.zig, the same flag that hides the language backend's durations) -# blanks the DIGITS rather than the row, because a message that disappeared -# under the harness could not be pinned at all. -# -# The row has exactly two possible occupants and they are not the same kind of -# thing. A MESSAGE is a report of something that already happened, and the next -# key or mouse event wipes it. An armed PROMPT is what that keystroke is being -# typed INTO, it lives until Enter or Esc, and it WINS. -lines a.txt 6 -start 15 70 a.txt -wait 8000 Newcol Joincol -wait 8000 a.txt -stable 700 20000 -snap opened -# Save (SPC f s) writes the file; the SHELL is where the write and the clock -# both are, so the shell is what posts the message once the bytes are down. -key space f s -stable 700 15000 -snap saved -# A REPAINT is not input. A resize redraws every cell in the window from -# scratch and the message is still there on the other side of it — the row is -# state, not one frame's flash. (Different rows, or the kernel sends no -# SIGWINCH and nothing repaints.) -resize 17 70 -stable 700 15000 -snap repainted -# ...but the next KEY takes it away. `j` is a plain cursor motion and changes -# nothing else on screen, so the vanishing message is the whole diff. -key j -stable 700 15000 -snap keycleared -# Again, and this time a bare mouse MOTION — no button, nothing clicked — -# clears it: any mouse event counts, the rule is "you are back", not "you did -# something". -key space f s -stable 700 15000 -snap saved-again -motion 20 6 -stable 700 15000 -snap mousecleared -# The other message: an external write lands in the pane (filewatch.snap owns -# that contract) and the row says which of the two things happened. `run` is a -# child of the RUNNER, so the app receives no keystroke here and nothing but -# the watch could have posted this. -run printf 'EXTERNAL\n' > a.txt -wait 10000 EXTERNAL -stable 700 15000 -snap reloaded -# `/` still types into the tag tail — same buffer, same offsets, same one-line -# editor, same Enter and Esc — but it is DRAWN here now, so the tagline keeps -# its builtins instead of losing them to a long pattern. Note the tag row above -# ends at `Del`: the marker and the pattern are no longer on it at all. (The -# `/` keystroke also cleared the reload message, which is the rule above.) -key s -text EXT -stable 700 15000 -snap prompt -# ...and a message arriving UNDER an armed prompt does not disturb it: a second -# external write reloads the pane and posts one, the row stays the prompt's. -run printf 'AGAIN\n' > a.txt -wait 10000 AGAIN -stable 700 15000 -snap prompt-wins -# Esc abandons the input, and the very key that abandoned it is also the key -# that clears the message queued underneath — so the row goes empty rather than -# handing back a report from before you started typing. -key esc -settle 100 -stable 700 15000 -snap esc -# Every other writer of this row is something going WRONG, which is a poor way -# to look at a row: `Msg ` is the word that writes it on purpose. An -# ordinary builtin, so it runs the ordinary way — write it in the buffer, -# select the line, execute it — and what lands is the text, verbatim, with the -# same stamped-looking left edge as the reports above. (The clock belongs to -# the SHELL, which is why this one has none: the core has no clock.) -key o -text Msg hand-written report -key esc -settle 100 -key x -key tab -stable 700 15000 -snap msgbuiltin -# A message wider than the pane keeps its TAIL, not its head: the end of a -# message is the part that says something -- a path's file name, an error's -# reason -- so the head is what a narrow pane goes without. -key j -key o -text Msg 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 THE-END -key esc -settle 100 -key x -key tab -stable 700 15000 -snap msgtail diff --git a/test/snapshots/nested-optout.snap b/test/snapshots/nested-optout.snap deleted file mode 100644 index 45cedab9..00000000 --- a/test/snapshots/nested-optout.snap +++ /dev/null @@ -1,24 +0,0 @@ -file nested.txt optout-marker\nsecond-optout-line\n -dirmk innerdir -file innerdir/deeper.txt deepest-marker\n -start 31 100 -wait 8000 $ -stable 700 20000 -text $(readlink /proc/$PPID/exe) --nested nested.txt -key enter -wait 20000 optout-marker -stable 700 20000 -snap optout-file -start 31 100 -wait 8000 $ -stable 700 20000 -text (cd innerdir && $(readlink /proc/$PPID/exe) --nested) -key enter -wait 20000 cwd/innerdir -stable 700 20000 -snap inner-shell -text $(readlink /proc/$PPID/exe) deeper.txt -key enter -wait 20000 deepest-marker -stable 700 20000 -snap inner-launch diff --git a/test/snapshots/nested.snap b/test/snapshots/nested.snap deleted file mode 100644 index c26b7cea..00000000 --- a/test/snapshots/nested.snap +++ /dev/null @@ -1,27 +0,0 @@ -dirmk nestdir -file nestdir/inside-nested.txt marker -file nested.txt hello-from-nested\nsecond-nested-line\n -start 31 100 -wait 8000 $ -stable 700 20000 -text $(readlink /proc/$PPID/exe) nested.txt -key enter -wait 15000 hello-from-nested -stable 700 20000 -snap file-arg -start 31 100 -wait 8000 $ -stable 700 20000 -text $(readlink /proc/$PPID/exe) -key enter -wait 15000 already inside pardes -stable 700 20000 -snap no-arg -start 31 100 -wait 8000 $ -stable 700 20000 -text $(readlink /proc/$PPID/exe) nestdir -key enter -wait 15000 inside-nested.txt -stable 700 20000 -snap dir-arg diff --git a/test/snapshots/ninep.snap b/test/snapshots/ninep.snap deleted file mode 100644 index 5ea33887..00000000 --- a/test/snapshots/ninep.snap +++ /dev/null @@ -1,21 +0,0 @@ -file demo.zig const greeting = "café λ 界 é";\n\npub fn choose(ok: bool) u32 {\n if (ok) return 42;\n return 7;\n}\n -start 15 90 demo.zig -wait 8000 choose -stable 400 10000 -snap opened -snapstyle opened -snap9p opened -key g g i -send // café λ 界\n -key esc -settle 100 -stable 300 8000 -snap edited -snap9p edited -snapstyle edited -resize 20 105 -stable 400 10000 -snapstyle resized -snap9p resized -snap resized -snap9p unchanged diff --git a/test/snapshots/restore.snap b/test/snapshots/restore.snap deleted file mode 100644 index 73f5c8ec..00000000 --- a/test/snapshots/restore.snap +++ /dev/null @@ -1,25 +0,0 @@ -# Dump writes to the resolved dump path ($PARDES_DUMP here; a timestamped file -# under ~/.local/share/pardes in live runs) and the topbar grows Restore ; -# middle-click Restore loads that dump back into the live session: output on -# screen at Dump time survives (pty history), later output does not -start 31 100 -n 1 -wait 8000 Newcol Joincol -stable 700 20000 -key c-b -stable 600 8000 -text echo KEEP''ME -key enter -wait 8000 KEEPME -stable 700 10000 -press middle @Dump 1 -release middle @Dump 1 -stable 700 10000 -snap dumped -text echo GONE''SOON -key enter -wait 8000 GONESOON -stable 700 10000 -press middle @Restore 1 -release middle @Restore 1 -stable 900 15000 -snap restored diff --git a/test/snapshots/savepane.snap b/test/snapshots/savepane.snap deleted file mode 100644 index 58df13ef..00000000 --- a/test/snapshots/savepane.snap +++ /dev/null @@ -1,33 +0,0 @@ -# `Save` with NO argument on a +New scratch: the prompt is drawn in the tag, -# prefilled with the pane's own directory, and submitting it turns the scratch -# into an ordinary file pane whose bytes are on disk. -# -# config.zig's save_marker is rendered in no other golden in the suite. Ten -# unit tests assert the STRING startSavePrompt builds (pardes.zig's "Save on a -# scratch asks for a path in its inherited dir and makes it a file"); none of -# them can see it drawn, land on the tag rather than the message row, or show -# what the pane becomes afterwards. That is what this script is for. -start 31 100 -n 1 -wait 8000 Newcol Joincol -stable 700 20000 -# a scratch of our own, with something in it to save -key space f n -stable 400 5000 -key i -text scratch bytes -key esc -settle 100 -stable 400 5000 -snap scratch -# Save, no argument: the tag gains the armed ` Save /` prompt, and the -# pane is still the scratch — nothing is written until the path is submitted -key space f s -stable 400 5000 -snap prompt -# name it: the prompt submits, the pane becomes that file (its tag is the path, -# and the `*` is gone because what is on screen is what is on disk) -text saved.txt -key enter -stable 700 15000 -snap saved -snapfile bytes saved.txt diff --git a/test/snapshots/shellset.snap b/test/snapshots/shellset.snap deleted file mode 100644 index 63fe03f1..00000000 --- a/test/snapshots/shellset.snap +++ /dev/null @@ -1,45 +0,0 @@ -# The Shell builtin names the binary the NEXT terminal execs. What is pinned -# here is the case that has to hold on a machine you did not set up: the name -# resolves to nothing, so Shell refuses it and says why on the message row, -# and the next pane opens anyway with the shell that was set before. -# -# A default $SHELL that names nothing executable falls back to /bin/sh -# (config.defaultShell), and the host's lookup still falls back at spawn for -# a shell that went away after it was set: a pane never gets a child that -# dies at exec and shows one EOF. -# -# The rest of the feature is unit-tested rather than pinned here, on purpose. -# Which family a binary belongs to, what argv each one gets and where the -# lookup searches are in host_io.Shell's own tests; the fish end of it cannot -# be a golden at all, because fish's prompt carries a hostname and its greeting -# a version number. (Every script in this suite runs bash, pinned through an -# ordinary config file the harness writes — see snapshot.zig.) -file cmd.txt Shell zznosuchshell -file zmarkfile.txt x -start 21 90 cmd.txt -wait 8000 Shell zznosuchshell -stable 700 20000 -snap boot -# execute the line the way you would run any command: select it, Tab. Nothing -# on any machine is installed under that name, so the resolver runs out of -# directories. (A file pane, so the line executed is the line you can see — -# typing into a terminal's overlay would leave `gg`/`x` selecting its output.) -key g g -key x -stable 400 5000 -key tab -stable 700 15000 -# NOTHING happened on screen, and that is the assertion: a name the builtin -# parser does not know is a command line, so it would have forked a terminal -# for this directory and printed `Shell: command not found` into it. One -# pane, no error — `Shell` was consumed as a builtin and its argument went -# with it. -snap builtin-ran -# a new terminal, which asks for a shell that is not there. It gets the -# fallback: the pane greets, `ls` runs, and its output is on screen. Alt-n and -# Alt-c, because `New`/`Newcol` open an empty +New scratch rather than a shell. -key a-n -key a-c -wait 15000 zmarkfile.txt -stable 700 20000 -snap fallback-shell diff --git a/test/snapshots/topbarexec.snap b/test/snapshots/topbarexec.snap deleted file mode 100644 index 81581b9d..00000000 --- a/test/snapshots/topbarexec.snap +++ /dev/null @@ -1,45 +0,0 @@ -# A topbar word runs on a middle click, and it runs WITH whatever is selected: -# sweep a word, click Grep, it greps that word. That is acme's 2-1 chord with -# no drag to chord into, and it is the whole reason the topbar reads the -# selection at all. -# -# But a selection is only an argument to a builtin that has somewhere to put -# one. `Exit`, `Debug`, `NextColor` and the rest match their name WHOLE — that -# is what makes `Exit foo` a shell command and not Exit — so splicing a sweep -# onto them produced a name matching no builtin, which fell out of the builtin -# parser and into a SHELL, as a command nobody typed (`bash: Debug: command -# not found`). It only ever bit you with a terminal open, because that is -# where the stray text went. -# -# So both halves are pinned here, against the same live selection: the no-arg -# builtin runs, and the arg-taking one still gets the word. -file zmarkfile.txt hay ZQNEEDLE stack -start 21 90 -n 3 -wait 8000 zmarkfile.txt -stable 700 20000 -# 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 -press left 3 6 -drag left 15 6 -release left 15 6 -stable 700 15000 -snap selected -# Debug takes NO argument. Middle-clicked with that sweep live it must open the -# overlay — not send `Debug zmarkfile.txt` to bash. The box IS the assertion. -press middle @Debug 1 -release middle @Debug 1 -stable 700 15000 -snap noarg-runs -# ...and off again, so the overlay does not cover what comes next -press middle @Debug 1 -release middle @Debug 1 -stable 700 15000 -# Find DOES take one, and still gets it: the sweep is the pattern, so the -# results buffer names the file it matched. An empty buffer would mean Find -# ran with no argument (which arms the prompt instead), so the ROW is the -# assertion — the splice is what put it there. -press middle @Find 1 -release middle @Find 1 -wait 10000 +Search -stable 700 15000 -snap arg-still-spliced diff --git a/test/snapshots/tutor.snap b/test/snapshots/tutor.snap deleted file mode 100644 index ab9cf8e0..00000000 --- a/test/snapshots/tutor.snap +++ /dev/null @@ -1,8 +0,0 @@ -# topbar middle-click Tutor opens the embedded tutor below its source shell -start 31 150 -n 3 -wait 8000 Newcol Joincol -stable 700 20000 -press middle @Tutor 1 -release middle @Tutor 1 -stable 700 15000 -snap tutor diff --git a/test/snapshots/winch.snap b/test/snapshots/winch.snap deleted file mode 100644 index d8cbb30a..00000000 --- a/test/snapshots/winch.snap +++ /dev/null @@ -1,19 +0,0 @@ -# SIGWINCH crash (reported as "crash on font-size change"): resizing the outer -# terminal delivers SIGWINCH, and vaxis's default handler locks std.Io mutexes -# from signal context — landing on a thread inside an Io.Threaded syscall -# region (pty readers in read(2), main parked in queue.pop) panicked the Io -# machinery and killed pardes. Now every thread blocks SIGWINCH and a sigwait -# watcher consumes it. The in-pane kill storm below crashed pardes before the -# fix; the resize after proves the watcher still reflows the grid. -start 31 100 -n 3 -stable 700 20000 -key c-b -stable 600 8000 -text for i in $(seq 600); do kill -WINCH $PPID; done; echo SUR''VIVED -key enter -wait 15000 SURVIVED -stable 700 15000 -snap storm -resize 35 106 -stable 700 15000 -snap resized -- cgit v1.3