diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 02:31:20 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | f749eb712d990a9b03f1db372d5311e77bd32edd (patch) | |
| tree | ee4d9966f1eb293054b7ed865c9d4d6eb49e432b /test | |
| parent | 8f6621f9f70db86d56266a59b56dfb92b324b0d9 (diff) | |
| parent | b3d32656413734952bc918c2d4cfd12fede6c214 (diff) | |
| download | pardes-f749eb712d990a9b03f1db372d5311e77bd32edd.tar.gz pardes-f749eb712d990a9b03f1db372d5311e77bd32edd.zip | |
integration: the terminal behind src/Term.zig, with the diff viewer and the plumber's first phase
A merge of term-phase0 and pardes-next. File.zig's recolorSyntax keeps the theme's grounds and names Term.Filter and Term.Span; the changelog keeps both sides' entries, the palette sentence in the place of the entry the terminal work cut down. core-test 985/985 on tui; the diff, pager and tree process cases pass, goldens unchanged.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour.zig | 1 | ||||
| -rw-r--r-- | test/behaviour/plumber.zig | 65 | ||||
| -rw-r--r-- | test/column_drag.zig | 58 | ||||
| -rw-r--r-- | test/lib/lib.zig | 54 | ||||
| -rw-r--r-- | test/process/tree.zig | 2 | ||||
| -rw-r--r-- | test/process/tty_editing.zig | 24 | ||||
| -rw-r--r-- | test/process/tty_images.zig | 2 | ||||
| -rw-r--r-- | test/process/tty_layout.zig | 141 | ||||
| -rw-r--r-- | test/replicas.zig | 76 | ||||
| -rw-r--r-- | test/session.zig | 3 | ||||
| -rw-r--r-- | test/snapshots/colgrip.golden | 147 | ||||
| -rw-r--r-- | test/snapshots/cornerdrag-left.golden | 86 | ||||
| -rw-r--r-- | test/snapshots/cornerdrag.golden | 239 | ||||
| -rw-r--r-- | test/snapshots/diffstack.golden | 61 | ||||
| -rw-r--r-- | test/snapshots/shrinktag.golden | 1 | ||||
| -rw-r--r-- | test/snapshots/windowops.golden | 162 | ||||
| -rw-r--r-- | test/soak.py | 21 |
17 files changed, 400 insertions, 743 deletions
diff --git a/test/behaviour.zig b/test/behaviour.zig index 5b31b6d9..9fe1f50b 100644 --- a/test/behaviour.zig +++ b/test/behaviour.zig @@ -25,6 +25,7 @@ test { _ = @import("behaviour/other_files.zig"); _ = @import("behaviour/panes.zig"); _ = @import("behaviour/placement.zig"); + _ = @import("behaviour/plumber.zig"); _ = @import("behaviour/repls.zig"); _ = @import("behaviour/root_ctl.zig"); _ = @import("behaviour/rules.zig"); diff --git a/test/behaviour/plumber.zig b/test/behaviour/plumber.zig new file mode 100644 index 00000000..f87c0449 --- /dev/null +++ b/test/behaviour/plumber.zig @@ -0,0 +1,65 @@ +//! docs/typ/reference.typ, The plumber <plumber>: plumb/rules and +//! plumb/send, Plan 9's plumber(4) files. +const std = @import("std"); +const Session = @import("session").Session; + +fn has(hay: []const u8, needle: []const u8) bool { + return std.mem.indexOf(u8, hay, needle) != null; +} + +test "plumber: plumb/rules reads the rules in force, a write adds rule sets, > replaces them, a bad one is refused in plumb(6)'s words, one writer at a time" { + var s = try Session.initFile(std.testing.allocator, "x\n"); + defer s.deinit(); + // The defaults, `include basic`'s rules in their place. + try std.testing.expect(has(try s.read("/plumb/rules"), "type\tis\ttext\ndata\tmatches\t'https?://.*'\nplumb\tto\tweb\n\n")); + // Added, the last rule set at the close. + try s.write("/plumb/rules", "type is text\ndata matches 'gopher://.*'\nplumb to web\n"); + try std.testing.expect(std.mem.endsWith(u8, try s.read("/plumb/rules"), "plumb\tto\tedit\n\ntype\tis\ttext\ndata\tmatches\t'gopher://.*'\nplumb\tto\tweb\n\n")); + // A rule set refused at the write it is whole in, said with its line; + // the rules stay as they were. + const before = try s.read("/plumb/rules"); + try std.testing.expectEqual(@as(u16, 22), try s.refused("/plumb/rules", "type is text\nplumb to web\n\ndata isnt x\nplumb to web\n\n")); + try std.testing.expectEqualStrings("plumb/rules:4: unknown verb isnt", s.said); + try std.testing.expectEqualStrings(before, try s.read("/plumb/rules")); + try std.testing.expectEqual(@as(u16, 22), try s.refused("/plumb/rules", "data matches '([a-z]+)\\.c'\narg isfile $1\nplumb to edit\n\n")); + try std.testing.expect(has(s.said, "$1: no submatches")); + // `>`: replaced. + const f = try s.hold("/plumb/rules", 1); + try s.truncate(f); + try std.testing.expectEqual(@as(u16, 0), try s.writeFid(f, "type is text\nplumb to edit\n\n")); + // One writer at a time, as plumber(4)'s. + try std.testing.expectError(error.Refused, s.hold("/plumb/rules", 1)); + s.clunk(f); + try std.testing.expectEqualStrings("type\tis\ttext\nplumb\tto\tedit\n\n", try s.read("/plumb/rules")); +} + +test "plumber: plumb/send takes a message in its six lines and data, written in pieces or whole, and sends it where the rules say, or says why not in Plan 9's words" { + var s = try Session.initFile(std.testing.allocator, "x\n"); + defer s.deinit(); + // A URL: the web port, the host's link opener. + try s.write("/plumb/send", "test\n\n/tmp\ntext\n\n19\nhttps://ziglang.org"); + try std.testing.expectEqualStrings("https://ziglang.org", s.link); + // In pieces: its data's count says when it is whole. + const f = try s.hold("/plumb/send", 1); + try std.testing.expectEqual(@as(u16, 0), try s.writeFid(f, "test\n\n/tmp\ntext\n\n19\nhttps://")); + try std.testing.expectEqualStrings("https://ziglang.org", s.link); + try std.testing.expectEqual(@as(u16, 0), try s.writeFid(f, "example.org")); + try std.testing.expectEqualStrings("https://example.org", s.link); + s.clunk(f); + // No rule takes it, and it names no port. + try std.testing.expect(try s.refused("/plumb/send", "test\n\n/\ntext\n\n9\nno-such-x") != 0); + try std.testing.expectEqualStrings("couldn't find destination for message", s.said); + // Not a message at all. + try std.testing.expect(try s.refused("/plumb/send", "test\ntext\n") != 0); + try std.testing.expectEqualStrings("bad plumb message format", s.said); + try std.testing.expect(try s.refused("/plumb/send", "a\nb\nc\nd\ne\n1\nxy") != 0); + try std.testing.expectEqualStrings("bad plumb message format", s.said); + // A file to the edit port: opened as Look opens one, at its place. + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "plumbed.txt", .data = "one\ntwo\nthree\n" }); + var buf: [4096]u8 = undefined; + const dir = buf[0..try tmp.dir.realPath(std.testing.io, &buf)]; + try s.write("/plumb/send", s.at("test\n\n{s}\ntext\n\n{d}\nplumbed.txt:2", .{ dir, "plumbed.txt:2".len })); + try std.testing.expect(has(try s.read("/index"), "/plumbed.txt")); +} diff --git a/test/column_drag.zig b/test/column_drag.zig index e64656e3..a12ca16f 100644 --- a/test/column_drag.zig +++ b/test/column_drag.zig @@ -84,7 +84,6 @@ test "column grip drag moves only its interval and keeps tag caret with the colu try std.testing.expect(p.view().drag == .column_move); mouse(p, .drag, target); _ = try p.render(frame.allocator()); - try std.testing.expectEqual(p.view().col_w[3] - pardes.TAG_TEXT_INSET - 1, (try tagLayer(p, 3)).viewport.w); try std.testing.expectEqual(last_rect, p.view().rects[p.view().cols[3].panes[0]]); try std.testing.expectEqual(last_columns, (try tagLayer(p, 3)).cols); try expectOrder(p, &before, &.{ 0, 1, 2, 3 }); @@ -121,7 +120,7 @@ test "column grip drag moves only its interval and keeps tag caret with the colu try std.testing.expect(p.view().drag == .none); } -test "column grip is separate from compact text and the resize seam" { +test "column grip is separate from compact text" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 24 }); defer p.deinit(); _ = try p.setTestFile("body\n"); @@ -160,11 +159,6 @@ test "column grip is separate from compact text and the resize seam" { mouse(p, .press, p.view().col_x[1] + config.GUTTER - 1); try std.testing.expect(p.view().drag == .column_move); mouse(p, .release, p.view().col_x[1] + config.GUTTER - 1); - const seam = p.view().col_x[0] + p.view().col_w[0] - 1; - const body_row = p.view().rects[p.view().cols[0].panes[0]].y + pardes.BOX_H + 1; - p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = seam, .row = body_row } }); - try std.testing.expect(p.view().drag == .border_v); - p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = seam, .row = body_row } }); } test "column grips stay blank, and muted across focus and hover until grabbed" { @@ -238,32 +232,7 @@ test "column grip dropped in its own place moves the column's left edge" { try std.testing.expectEqual(serials[0], p.view().cols[1].serial); } -/// The column of the drag preview's rail, checked to run the full height -/// below the workspace tag in the grabbed grip's color, except through the -/// grip and pane boxes at the window's left edge. -fn previewRail(p: *Pardes, frame: *std.heap.ArenaAllocator) !?u16 { - _ = frame.reset(.retain_capacity); - const surface = try p.render(frame.allocator()); - const lit: pardes.Color = .{ .rgb = p.chromeTheme().column_box }; - var found: ?u16 = null; - for (0..surface.cols) |x| { - if (!std.mem.eql(u8, surface.at(@intCast(x), surface.rows - 1).grapheme(), "╎")) continue; - try std.testing.expect(found == null); - found = @intCast(x); - for (p.topBarHeight()..surface.rows) |row| { - const cell = surface.at(@intCast(x), @intCast(row)); - if (x < config.GUTTER and cell.style.font_role == .tagline) { - try std.testing.expect(!std.mem.eql(u8, cell.grapheme(), "╎")); - continue; - } - try std.testing.expectEqualStrings("╎", cell.grapheme()); - try std.testing.expectEqual(lit, cell.style.fg); - } - } - return found; -} - -test "column grip drag previews where the column lands, in the seam beside its rule" { +test "column grip drag lands where it is carried, lighting no word on the way" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 24 }); defer p.deinit(); _ = try p.setTestFile("body\n"); @@ -278,15 +247,10 @@ test "column grip drag previews where the column lands, in the seam beside its r _ = try p.render(frame.allocator()); const serials = .{ p.view().cols[0].serial, p.view().cols[1].serial, p.view().cols[2].serial }; - // Held on its own grip it lands nowhere new: no rail. + // Over the first column's left half it goes first. mouse(p, .press, p.view().col_x[1]); - mouse(p, .drag, p.view().col_x[1] + 1); - try std.testing.expectEqual(@as(?u16, null), try previewRail(p, &frame)); - // Over the first column's left half it goes first. The window edge has - // no seam, and the gutter there is the GUI's scroll rail, so the rail - // runs in the gutter's last cell. mouse(p, .drag, 3); - try std.testing.expectEqual(@as(?u16, config.GUTTER - 1), try previewRail(p, &frame)); + _ = try p.render(frame.allocator()); // The pointer is over the first column's "New", but a carried column // aims at a place: no word lights under it. for (0..p.view().screen_w) |x| try std.testing.expect(!std.meta.eql(p.surface.at(@intCast(x), pardes.TOPBAR_H).style.bg, pardes.Color{ .rgb = p.theme().sel_bg })); @@ -294,28 +258,18 @@ test "column grip drag previews where the column lands, in the seam beside its r try std.testing.expectEqual(serials[1], p.view().cols[0].serial); try std.testing.expectEqual(serials[0], p.view().cols[1].serial); - // Past the middle column's middle it lands after it: the rail is in the - // seam cell left of the last column's rule, where a border drag's is. + // Past the last column's middle it goes last. mouse(p, .press, p.view().col_x[0]); - const past = p.view().col_x[1] + p.view().col_w[1] - 2; - mouse(p, .drag, past); - try std.testing.expectEqual(@as(?u16, p.view().col_x[2] - 1), try previewRail(p, &frame)); - // Past the last column's middle: the window's last cell. mouse(p, .drag, p.view().col_x[2] + p.view().col_w[2] - 1); - try std.testing.expectEqual(@as(?u16, p.view().screen_w - 1), try previewRail(p, &frame)); mouse(p, .release, p.view().col_x[2] + p.view().col_w[2] - 1); try std.testing.expectEqual(serials[0], p.view().cols[0].serial); try std.testing.expectEqual(serials[2], p.view().cols[1].serial); try std.testing.expectEqual(serials[1], p.view().cols[2].serial); - // Short of a neighbour's middle the left edge moves, and the preview - // is the seam that edge will have: exactly where the release puts it. + // Short of a neighbour's middle the left edge moves. const edge = p.view().col_x[2]; mouse(p, .press, edge + 1); - mouse(p, .drag, edge + 1 - 6); - try std.testing.expectEqual(@as(?u16, edge - 6 - 1), try previewRail(p, &frame)); mouse(p, .release, edge + 1 - 6); _ = try p.render(frame.allocator()); try std.testing.expectEqual(edge - 6, p.view().col_x[2]); - try std.testing.expectEqual(@as(?u16, null), try previewRail(p, &frame)); } diff --git a/test/lib/lib.zig b/test/lib/lib.zig index a3f99b56..7e297920 100644 --- a/test/lib/lib.zig +++ b/test/lib/lib.zig @@ -102,6 +102,60 @@ test "a C and a Zig source are coloured, outlined and walked as pardes has them, try std.testing.expectEqual(null, pardes.theme("no such theme")); } +test "a diff is a language: its hunks coloured as their file's, its added and removed rows on a theme's grounds" { + const gpa = std.testing.allocator; + pardes.start(gpa); + defer pardes.stop(); + const patch = + \\diff --git a/main.c b/main.c + \\--- a/main.c + \\+++ b/main.c + \\@@ -1,3 +1,3 @@ + \\ int main(void) { + \\- return 1; + \\+ return 0; + \\ } + \\ + ; + const styles = try pardes.highlightDiff(gpa, patch, 0, patch.len); + defer gpa.free(styles); + try std.testing.expectEqual(patch.len, styles.len); + const syn = struct { + fn at(s: []const u8, text: []const u8, needle: []const u8) pardes.Syn { + return @fromBackingInt(s[std.mem.indexOf(u8, text, needle).?] & pardes.syn_bits); + } + }.at; + try std.testing.expectEqual(pardes.Syn.comment, syn(styles, patch, "--- a/main.c")); + try std.testing.expectEqual(pardes.Syn.keyword, syn(styles, patch, "@@ -1,3")); + // each side's code as C, behind its marker + try std.testing.expectEqual(pardes.Syn.keyword, syn(styles, patch, "return 1")); + try std.testing.expectEqual(pardes.Syn.keyword, syn(styles, patch, "return 0")); + try std.testing.expectEqual(pardes.Syn.number, syn(styles, patch, "0;")); + const added = std.mem.indexOf(u8, patch, "+ return 0").?; + const removed = std.mem.indexOf(u8, patch, "- return 1").?; + try std.testing.expectEqual(pardes.ground_add | pardes.ground_emph, styles[added]); + try std.testing.expect(styles[added + 5] & pardes.ground_add != 0 and styles[added + 5] & pardes.ground_emph == 0); + try std.testing.expectEqual(pardes.ground_del | pardes.ground_emph, styles[removed]); + try std.testing.expectEqual(0, styles[std.mem.indexOf(u8, patch, " int main").?] & (pardes.ground_add | pardes.ground_del)); + + // a row's hue in a theme: a ground between the page and the theme's green, a stronger and a fainter one + const th = pardes.theme("Orchard").?; + const g = pardes.Grounds.of(th); + const ground = g.forStyle(styles[added]).?; + try std.testing.expectEqual(g.add, ground); + try std.testing.expectEqual(g.del, g.forStyle(styles[removed]).?); + try std.testing.expectEqual(null, g.forStyle(@backingInt(pardes.Syn.keyword))); + try std.testing.expect(!std.mem.eql(u8, &ground.row, &pardes.page(th)) and !std.mem.eql(u8, &ground.row, &ground.emph) and !std.mem.eql(u8, &ground.row, &ground.line)); + + // what a row points at: the new line a `+` row is + var lines: std.ArrayList([]const u8) = .empty; + defer lines.deinit(gpa); + var it = std.mem.splitScalar(u8, patch, '\n'); + while (it.next()) |line| try lines.append(gpa, line); + var buf: [64]u8 = undefined; + try std.testing.expectEqualStrings("main.c:2", pardes.diff.targetAt(lines.items, 6, false).?.address(&buf).?); +} + test "every name the library has compiles outside pardes" { std.testing.refAllDecls(pardes); } diff --git a/test/process/tree.zig b/test/process/tree.zig index d28ac1ed..8fe3d881 100644 --- a/test/process/tree.zig +++ b/test/process/tree.zig @@ -105,7 +105,7 @@ fn discovery(gpa: std.mem.Allocator, exe: [:0]const u8) !void { const top = try c.list(a, "/"); // A set: which files the root holds, not the order a listing gives. - const want = [_][]const u8{ "README", "index", "status", "focus", "ctl", "commands", "recent", "dumps", "addons", "look", "exec", "pager", "log", "screen", "listeners", "sessions", "layout", "tag", "tagexec", "kbdin", "mousein", "pane", "col", "os" }; + const want = [_][]const u8{ "README", "index", "status", "focus", "ctl", "commands", "recent", "dumps", "addons", "look", "exec", "pager", "log", "screen", "listeners", "sessions", "layout", "tag", "tagexec", "kbdin", "mousein", "plumb", "pane", "col", "os" }; var others: usize = 0; for (top) |n| { if (contains(&.{ "src", "shaders" }, n)) continue; diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index 72cbb573..b5f0495c 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -35,6 +35,7 @@ pub const cases = .{ .{ "tty editing: lsp-rename-files", lsp_rename_files }, .{ "tty editing: callstack", callstack }, .{ "tty editing: diffview", diffview }, + .{ "tty editing: diffstack", diffstack }, .{ "tty editing: dirpane", dirpane }, .{ "tty editing: scrolloff", scrolloff }, .{ "tty editing: wrap", wrap }, @@ -2018,6 +2019,29 @@ fn diffview(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.done(); } +// A diff paged (`pardes -`) is stacked in a +Diff: its hunk found where the +// file has moved it since (two lines further down), under the declaration it +// stands in (`a.zig:3`, `const S = struct {`) and its label one level deep +// (`a.zig:5 *`); a changed line's changed word on a stronger ground in both +// lines (`c` and `a`), and a line added whole (`log();`) on a faint one, each +// marker in its tint's hue. +fn diffstack(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "diffstack"); + defer t.deinit(); + try t.file("a.zig", "// one\n// two\nconst S = struct {\n fn f() void {\n a();\n b();\n log();\n }\n};\n"); + try t.file("change.patch", "--- a.zig\n+++ a.zig\n@@ -3,4 +3,5 @@ git's guess\n fn f() void {\n- c();\n+ a();\n b();\n+ log();\n }\n"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("cat change.patch | $(readlink /proc/$PPID/exe) -"); + try t.key("enter"); + try t.wait(20000, "a.zig:5 *"); + try t.stable(700, 20000); + try t.snap("diff-stack"); + try t.style("diff-stack-colours"); + try t.done(); +} + // a look at a directory opens a pane named for it with a trailing /, its // entries in columns as acme's directory window lays them out: down each // column first, a directory's marked /, dotfiles shown. A look at an entry diff --git a/test/process/tty_images.zig b/test/process/tty_images.zig index dea9feef..5c39d4f3 100644 --- a/test/process/tty_images.zig +++ b/test/process/tty_images.zig @@ -50,7 +50,7 @@ fn images(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // the tag takes an edit like any other pane's now — nothing live left in it to // protect, so the image early-return in enterTagEdit is gone. The image-state // prefix is wider than this source-local column, so widen the grid for this - // final assertion. (A column-border drag intentionally takes width from only + // final assertion. (A column grip drag intentionally takes width from only // one neighbour, which cannot expose this 82-column prefix.) Then click the // visible tail itself, at its `Term`. This proves the image tag is an ordinary // editor rather than accidentally typing at a clipped read-only path. diff --git a/test/process/tty_layout.zig b/test/process/tty_layout.zig index 84f76be7..08a02488 100644 --- a/test/process/tty_layout.zig +++ b/test/process/tty_layout.zig @@ -5,8 +5,6 @@ const Tty = @import("../tty.zig").Tty; pub const cases = .{ .{ "tty layout: colgrip", colgrip }, .{ "tty layout: collapse", collapse }, - .{ "tty layout: cornerdrag", cornerdrag }, - .{ "tty layout: cornerdrag-left", cornerdrag_left }, .{ "tty layout: delask", delask }, .{ "tty layout: emptycol", emptycol }, .{ "tty layout: layout-close", layout_close }, @@ -20,7 +18,7 @@ pub const cases = .{ }; // Column grips: the two cells left of a column tag carry the column. A grabbed -// grip lights, and a rail in its color stands where the column will land. +// grip lights. // The right column is at x 50; its grip is cells 51-52 (1-based) on row 2. fn colgrip(gpa: std.mem.Allocator, exe: [:0]const u8) !void { var t = try Tty.init(gpa, exe, "colgrip"); @@ -34,12 +32,11 @@ fn colgrip(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("a-c"); try t.stable(700, 15000); try t.style("rest"); - // held on its own grip: lit, and no rail, since it lands where it is + // held on its own grip: lit try t.press("left", "51", 2); try t.stable(400, 5000); try t.style("held"); - // dropped short of the left column's middle, the left edge moves: the rail is - // in the seam cell left of where the column's rule will be + // dropped short of the left column's middle, the left edge moves try t.drag("left", "41", 2); try t.stable(400, 5000); try t.snap("resize-drag"); @@ -47,8 +44,7 @@ fn colgrip(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.release("left", "41", 2); try t.stable(700, 15000); try t.snap("resize-done"); - // carried over the left column's left half it goes first; the window edge - // has no seam, so the rail runs in the gutter's last cell + // carried over the left column's left half it goes first try t.press("left", "41", 2); try t.drag("left", "10", 2); try t.stable(400, 5000); @@ -107,109 +103,6 @@ fn collapse(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.done(); } -// corner grabs: where a column edge crosses a pane edge, ONE drag moves both. -// Only the left column's h-splits make a corner — the v handle IS that column's -// last cell, so that is the only pane pair whose horizontal hint runs through -// it, and a corner therefore sits exactly where the two lines visibly cross. -// The layout is windowops': col 0 (x 0, w 50) holds panes 0 (rows 1-15) and 1 -// (rows 16-29), col 1 holds one pane. The corner is col 49, row 15. -fn cornerdrag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { - var t = try Tty.init(gpa, exe, "cornerdrag"); - defer t.deinit(); - try t.file("w.txt", "x"); - try t.start(31, 100, &.{ "-n", "3" }); - try t.wait(8000, "w.txt"); - try t.stable(700, 20000); - // hover the corner: no hints (columns resize by their grips); the frame - // stays empty - try t.motion("50", 16); - try t.stable(400, 5000); - try t.snap("hover-corner"); - // CONTROL: the same vertical edge ten rows off the crossing is a plain edge. - // The identical diagonal drag moves the column and nothing else — pane 0 still - // ends on row 15, and the preview is one dash, not two - try t.press("left", "50", 7); - try t.drag("left", "30", 25); - try t.stable(400, 5000); - try t.snap("edge-drag"); - try t.release("left", "30", 25); - try t.motion("45", 25); - try t.stable(500, 8000); - try t.snap("edge-done"); - // the corner itself, now at col 0's new last col (29) and still row 15: drag it - // up and to the right and both boundaries follow the one mouse - try t.press("left", "30", 17); - try t.drag("left", "60", 9); - try t.stable(400, 5000); - try t.snap("corner-drag"); - try t.release("left", "60", 9); - try t.motion("45", 25); - try t.stable(500, 8000); - try t.snap("corner-done"); - // clamp interaction, half one: shove the corner off the right edge while - // staying mid-height. The column preview parks at its MINW stop; the row - // preview keeps tracking the mouse exactly - try t.press("left", "60", 9); - try t.drag("left", "99", 21); - try t.stable(400, 5000); - try t.snap("clamp-x"); - // half two, the mirror: below the bottom at mid-width. Now the ROW preview - // parks (the lower pane keeps its tag row) and the COLUMN keeps tracking - try t.drag("left", "60", 31); - try t.stable(400, 5000); - try t.snap("clamp-y"); - try t.release("left", "60", 31); - try t.motion("45", 25); - try t.stable(500, 8000); - try t.snap("clamp-done"); - try t.done(); -} - -// corner grabs on the RIGHT column's side of the v border. The v handle is the -// LEFT column's last cell, so that column's own h hint runs THROUGH it while the -// right column's hints start one cell further right — the crossing there reads as -// a T butting into the junction rather than a full cross, and it is grabbable all -// the same: one drag moves the column edge and the RIGHT column's pane edge. -// Layout: windowops' -n 3 (col 0 x 0 w 50, panes on rows 1-15 and 16-29; col 1 -// x 50 w 50), then focus right and Alt-n so col 1 holds two panes as well, split -// at ITS own row. The two corners on col 49 are then row 16 (col 0's seam, the -// one that already worked) and row 5 (col 1's, the one this script is about). -fn cornerdrag_left(gpa: std.mem.Allocator, exe: [:0]const u8) !void { - var t = try Tty.init(gpa, exe, "cornerdrag-left"); - defer t.deinit(); - try t.file("w.txt", "x"); - try t.start(31, 100, &.{ "-n", "3" }); - try t.wait(8000, "w.txt"); - try t.stable(700, 20000); - // a second pane in the RIGHT column - try t.key("c-w l enter"); - try t.stable(400, 5000); - try t.key("a-n"); - try t.stable(700, 15000); - try t.snap("right-split"); - // hover col 1's corner: hovering draws no hints any more, so the frame is - // empty; the drags below still show their previews - try t.motion("50", 5); - try t.stable(400, 5000); - try t.snap("hover-corner"); - // CONTROL: col 0's own seam, hovered: no hint either - try t.motion("50", 16); - try t.stable(400, 5000); - try t.snap("hover-left-corner"); - // grab col 1's corner and drag down-left: the column preview and col 1's row - // preview both follow the one mouse, the row dashes lying to the RIGHT of the v - // line because they are the right column's - try t.press("left", "50", 6); - try t.drag("left", "30", 13); - try t.stable(400, 5000); - try t.snap("corner-drag"); - try t.release("left", "30", 13); - try t.motion("45", 25); - try t.stable(500, 8000); - try t.snap("corner-done"); - try t.done(); -} - // Del from the keyboard on a pane with open panes above AND below asks, on the // pane's notice band, which one takes its rows: k above, j below, anything else // keeps the pane. A click, and DelAbove/DelBelow (Del k / Del j), never ask. @@ -479,8 +372,8 @@ fn shrinktag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.motion("40", 25); try t.stable(500, 8000); try t.snap("shrunk"); - // the shrunk pane's gutter box grabs a move: preview one into the right - // column, abort by releasing over the pane itself + // the shrunk pane's gutter box grabs a move: carried into the right column + // nothing shows until the release, aborted by releasing over the pane itself try t.press("left", "1", 3); try t.drag("left", "70", 9); try t.stable(400, 5000); @@ -576,10 +469,11 @@ fn tagalign2col(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("a-n"); try t.stable(700, 15000); try t.snap("aligned"); - // Resizing moves the right column as a whole and clips without hidden spaces. - try t.press("left", "80", 11); - try t.drag("left", "100", 11); - try t.release("left", "100", 11); + // Resizing by the right column's grip moves it as a whole and clips + // without hidden spaces. + try t.press("left", "81", 2); + try t.drag("left", "101", 2); + try t.release("left", "101", 2); try t.stable(700, 15000); try t.snap("widened"); try t.done(); @@ -665,7 +559,7 @@ fn windownav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.done(); } -// hover (no hints), border drags, grip resize, move drag, Alt-n, Ctrl-w focus (window mode), Debug box +// hover (no hints), grip resize, move drag, Alt-n, Ctrl-w focus (window mode), Debug box fn windowops(gpa: std.mem.Allocator, exe: [:0]const u8) !void { var t = try Tty.init(gpa, exe, "windowops"); defer t.deinit(); @@ -681,14 +575,6 @@ 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"); - // drag the vertical border 10 cols left - try t.press("left", "50", 11); - try t.drag("left", "40", 11); - try t.stable(400, 5000); - try t.snap("border-drag"); - try t.release("left", "40", 11); - try t.stable(500, 8000); - try t.snap("border-done"); // resize the left pair by the lower pane's grip, 4 rows up (a terminal has no // rule between panes; pane 0's last row is now 13) try t.press("left", "1", 18); @@ -696,7 +582,8 @@ fn windowops(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.release("left", "1", 14); try t.stable(500, 8000); try t.snap("hborder-done"); - // move pane 1 (its gutter box) into the right column + // move pane 1 (its gutter box) into the right column: nothing shows until + // the release try t.press("left", "1", 18); try t.drag("left", "70", 9); try t.stable(400, 5000); diff --git a/test/replicas.zig b/test/replicas.zig index 5208f6ac..c100a8c1 100644 --- a/test/replicas.zig +++ b/test/replicas.zig @@ -213,6 +213,13 @@ fn writeFile(path: [:0]const u8, lines: usize) !void { } } +fn writeText(path: [:0]const u8, text: []const u8) !void { + const fd = libc.open(path, .{ .ACCMODE = .WRONLY, .CREAT = true, .TRUNC = true }, @as(libc.mode_t, 0o644)); + if (fd < 0) return error.OpenFailed; + defer _ = libc.close(fd); + if (libc.write(fd, text.ptr, text.len) != @as(isize, @intCast(text.len))) return error.WriteFailed; +} + const Run = struct { seed: u64, rtt_ms: u64, steps: usize, clients: u16, shared: bool, flood_mb: u64 }; /// The terminal pane's screen as a hash of screen_state's dump of it. @@ -470,6 +477,73 @@ fn run(r: Run, dir: []const u8, totals: *Totals) !void { } } +/// A .patch looked at opens a +Diff, whose rows are made from files read +/// in the step (hunks.zig: the patch, the file each section names, its +/// declarations). Looked at by the authority, a replica replays the reads +/// the unit carries and makes the same +Diff; looked at as the replica's own +/// input, the first read poisons the speculation, which shows nothing and +/// waits for the authority's unit (no rollback of what it showed). Either +/// way the replica's digest and the +Diff's text are the authority's. +fn diffCase(dir: []const u8) !bool { + var host: Host = .{}; + defer { + for (host.echo.items) |e| gpa.free(e.bytes); + host.echo.deinit(gpa); + } + var buf: [256]u8 = undefined; + const source = try std.fmt.bufPrintSentinel(&buf, "{s}/a.zig", .{dir}, 0); + try writeText(source, "// one\n// two\nconst S = struct {\n fn f() void {\n a();\n b();\n log();\n }\n};\n"); + var pbuf: [256]u8 = undefined; + const patch = try std.fmt.bufPrintSentinel(&pbuf, "{s}/change.patch", .{dir}, 0); + try writeText(patch, "--- a.zig\n+++ a.zig\n@@ -3,4 +3,5 @@\n fn f() void {\n- c();\n+ a();\n b();\n+ log();\n }\n"); + var lbuf: [300]u8 = undefined; + const look = try std.fmt.bufPrint(&lbuf, "Look {s}", .{patch}); + var ok = true; + for ([_]bool{ false, true }) |own| { + const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty }, host.host(), true); + defer a.deinit(); + const first = try gpa.dupe(u8, try a.unit(0, 0)); + defer gpa.free(first); + const rp = try replica.Replica.init(gpa, 1, first, true); + defer rp.deinit(); + if (own) { + const msg = try gpa.dupe(u8, try rp.input(.{ .command = look })); + defer gpa.free(msg); + if (rp.stats.stopped != 1) { + std.debug.print("diff: the replica's own look at a .patch was not stopped at its first read ({d} stopped, {d} applied)\n", .{ rp.stats.stopped, rp.stats.speculated }); + ok = false; + } + if (try a.pending()) |batch| rp.confirm(batch); + rp.confirm(try a.take(msg)); + } else rp.confirm(try a.local(.{ .command = look })); + rp.settle(); + const named = for (a.core.panes, 0..) |slot, pid| { + const f = (slot orelse continue).file orelse continue; + if (std.mem.endsWith(u8, f.path, "/+Diff")) break pid; + } else null; + const mine = if (named) |pid| if (rp.core().panes[pid]) |pane| pane.file else null else null; + if (named == null or mine == null or !std.mem.eql(u8, a.core.panes[named.?].?.file.?.content, mine.?.content) or + std.mem.indexOf(u8, mine.?.content, "a.zig:5 *") == null) + { + std.debug.print("diff: {s}: the replica holds no +Diff of the authority's\n", .{if (own) "its own look" else "the authority's look"}); + ok = false; + } + if (rp.diverged) |why| { + std.debug.print("diff: {s}: the replica diverged: {s}\n", .{ if (own) "its own look" else "the authority's look", why }); + ok = false; + } else if (!rp.quiet() or rp.digest() != replica.digestOf(a)) { + std.debug.print("diff: {s}: the replica's digest is not the authority's\n", .{if (own) "its own look" else "the authority's look"}); + ok = false; + } + if (rp.stats.mispredicted + rp.stats.foreign != 0) { + std.debug.print("diff: {s}: {d} rollbacks\n", .{ if (own) "its own look" else "the authority's look", rp.stats.mispredicted + rp.stats.foreign }); + ok = false; + } + } + std.debug.print("diff: a .patch looked at by the authority and as a replica's own input: {s}\n", .{if (ok) "the same +Diff" else "FAILED"}); + return ok; +} + fn push(q: *std.PriorityQueue(Msg, void, Msg.order), nn: *u64, m: Msg) !void { var mm = m; mm.n = nn.*; @@ -1437,7 +1511,7 @@ pub fn main(init: std.process.Init) !void { if (!try echoMain(seeds, first, rtts)) std.process.exit(1); return; } - var failed = false; + var failed = !try diffCase(dir); std.debug.print("{d} seeds x {d} inputs from each of {d} clients, {s}, a TUI then {d} MB of yes in the shell; costs in us (frame {d})\n", .{ seeds, steps, clients, if (shared) "sharing one view" else "a view each", flood_mb, frame_us }); std.debug.print(" rtt inputs at-once stopped view units fast rollback(mis+foreign) rate rebase spec p50/p99 copy p50/p99 (KB) rollback p50/p99 diverged unequal\n", .{}); var term_lines: std.ArrayList(u8) = .empty; diff --git a/test/session.zig b/test/session.zig index fd956aa9..056966b9 100644 --- a/test/session.zig +++ b/test/session.zig @@ -30,6 +30,8 @@ pub const Session = struct { arena: std.heap.ArenaAllocator, /// Saves the core asked its host for (a host would perform them). saved: usize = 0, + /// The last link the core asked its host to open (a browser would). + link: []const u8 = "", /// The words of the last refusal `refused` answered. said: []const u8 = "", tag: u64 = 0, @@ -277,6 +279,7 @@ pub const Session = struct { fn drain(s: *Session) void { while (pardesOf(s).nextEffect()) |e| switch (e) { .save_file, .save_text => s.saved += 1, + .open_link => |u| s.link = s.arena.allocator().dupe(u8, u.slice()) catch "", // Into the session's state (a database in memory, or its file). .write_dump => pardes.host_io.writeDump(pardesOf(s), pardesOf(s).dump_out.?), .addon => pardesOf(s).perform(e), diff --git a/test/snapshots/colgrip.golden b/test/snapshots/colgrip.golden index a76642b1..a64be69c 100644 --- a/test/snapshots/colgrip.golden +++ b/test/snapshots/colgrip.golden @@ -27,143 +27,46 @@ |1: 0-1 d,#887455, 2-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#f4c086, 52-99 #becfc4,#314738, == snap resize-drag grid=100x24 cursor=54,6 | Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit -| New Term Find Grep Joincol Delcol ╎ New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/colgrip/cwd/w.txt Sa╎e Term Col /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode -| lapse Follow Del ╎ Filter Collapse Del -| 1 x ╎ ls -| ╎ w.txt -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ +| New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol +| /tmp/pardes-snap/colgrip/cwd/w.txt Save Term Col /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode +| lapse Follow Del Filter Collapse Del +| 1 x ls +| w.txt == style resize-drag grid=100x24 -|1: 0-1 d,#887455, 2-38 #b2c3b8,#1d2824, 39-49 #f4c086,#1d2824, 50-51 #f4c086,#f4c086, 52-99 #becfc4,#314738, -|2: 0-1 d,#496656, 2-30 #b2c3b8,#1d2824, 31-36 #d3b0d9,#1d2824, 37-38 #b2c3b8,#1d2824, 39-39 #f4c086,#1d2824, 40-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#add38a, 52-80 #becfc4,#314738, 81-90 #dfbce5,#314738, 91-99 #becfc4,#314738, -|3: 0-1 d,#1d2824, 2-38 #b2c3b8,#1d2824, 39-49 #f4c086,#1d2824, 50-52 #f4c086,#314738, 53-99 #becfc4,#314738, -|4: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-38 #e5eee5,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-51 #f4c086,#0d1410, 52-99 #e5eee5,#0d1410, -|5: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-51 #f4c086,#0d1410, 52-99 #e5eee5,#0d1410, -|6: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|7: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|8: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|9: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|10: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|11: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|12: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|13: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|14: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|15: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|16: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|17: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|18: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|19: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|20: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|21: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|22: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|23: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, == snap resize-done grid=100x24 cursor=44,6 |1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol |2: /tmp/pardes-snap/colgrip/cwd/w.txt Sav /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode Filter Co |3: e Term Collapse Follow Del llapse Del |4: 1 x ls |5: w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: == snap reorder-drag grid=100x24 cursor=44,6 -|4: ╎ 1 x ls -|5: ╎ w.txt -|6: ╎ -|7: ╎ -|8: ╎ -|9: ╎ -|10: ╎ -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: ╎ -|18: ╎ -|19: ╎ -|20: ╎ -|21: ╎ -|22: ╎ -|23: ╎ == style reorder-drag grid=100x24 |1: 0-1 d,#887455, 2-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#f4c086, 42-99 #becfc4,#314738, |2: 0-1 d,#496656, 2-30 #b2c3b8,#1d2824, 31-36 #d3b0d9,#1d2824, 37-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#add38a, 42-70 #becfc4,#314738, 71-80 #dfbce5,#314738, 81-99 #becfc4,#314738, |3: 0-1 d,#1d2824, 2-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#314738, 42-99 #becfc4,#314738, -|4: 0-0 d,#608269, 1-4 #f4c086,#0d1410, 5-6 #59675c,#0d1410, 7-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|5: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-41 #f4c086,#0d1410, 42-99 #e5eee5,#0d1410, -|6: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|7: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|8: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|9: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|10: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|11: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|12: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|13: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|14: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|15: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|16: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|17: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|18: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|19: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|20: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|21: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|22: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|23: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, +|4: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, +|5: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-41 d,#0d1410, 42-99 #e5eee5,#0d1410, +|6: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|7: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|8: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|9: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|10: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|11: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|12: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|13: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|14: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|15: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|16: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|17: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|18: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|19: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|20: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|21: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|22: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|23: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, == snap reorder-done grid=100x24 cursor=4,6 |1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol |2: /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode Filter Co /tmp/pardes-snap/colgrip/cwd/w.txt Sav |3: llapse Del e Term Collapse Follow Del |4: ls 1 x |5: w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: diff --git a/test/snapshots/cornerdrag-left.golden b/test/snapshots/cornerdrag-left.golden deleted file mode 100644 index d5c7b7fd..00000000 --- a/test/snapshots/cornerdrag-left.golden +++ /dev/null @@ -1,86 +0,0 @@ -== snap right-split grid=100x31 cursor=54,11 -| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit -| New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -| ave Mode Filter Collapse Del ave Mode Filter Collapse Del -| ls ls -| w.txt w.txt -| -| /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -| ave Mode Filter Collapse Del -| ls -| w.txt -| -| -| -| -| -| -| /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -| ave Mode Filter Collapse Del -| ls -| w.txt -== snap hover-corner grid=100x31 cursor=54,11 -== snap hover-left-corner grid=100x31 cursor=54,11 -== snap corner-drag grid=100x31 cursor=54,11 -|1: New Term Find Grep Joincol ╎elcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag╎left/cwd Term+bash S /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -|3: ave Mode Filter Collapse De╎ ave Mode Filter Collapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|6: ╎ -|7: ╎ /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -|8: ╎ ave Mode Filter Collapse Del -|9: ╎ ls -|10: ╎ w.txt -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: /tmp/pardes-snap/cornerdrag╎left/cwd Term+bash S -|18: ave Mode Filter Collapse De╎ -|19: ls ╎ -|20: w.txt ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap corner-done grid=100x31 cursor=34,11 -|1: New Term Find Grep Joincol D New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag- /tmp/pardes-snap/cornerdrag-left/cwd Term+bash Save Mode Filter Coll -|3: left/cwd Term+bash Save Mode apse Del -|4: Filter Collapse Del ls -|5: ls w.txt -|6: w.txt -|7: /tmp/pardes-snap/cornerdrag-left/cwd Term+bash Save Mode Filter Coll -|8: apse Del -|9: ls -|10: w.txt -|11: -|12: -|13: -|14: -|15: -|16: -|17: /tmp/pardes-snap/cornerdrag- -|18: left/cwd Term+bash Save Mode -|19: Filter Collapse Del -|20: ls -|21: w.txt -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: diff --git a/test/snapshots/cornerdrag.golden b/test/snapshots/cornerdrag.golden deleted file mode 100644 index bd552949..00000000 --- a/test/snapshots/cornerdrag.golden +++ /dev/null @@ -1,239 +0,0 @@ -== snap hover-corner grid=100x31 cursor=4,6 -| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit -| New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M -| ode Filter Collapse Del ode Filter Collapse Del -| ls ls -| w.txt w.txt -| -| -| -| -| -| -| -| -| -| -| -| /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M -| ode Filter Collapse Del -| ls -| w.txt -== snap edge-drag grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol ╎elcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag╎cwd Term+bash Save M /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M -|3: ode Filter Collapse Del ╎ ode Filter Collapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|6: ╎ -|7: ╎ -|8: ╎ -|9: ╎ -|10: ╎ -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: /tmp/pardes-snap/cornerdrag╎cwd Term+bash Save M -|18: ode Filter Collapse Del ╎ -|19: ls ╎ -|20: w.txt ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap edge-done grid=100x31 cursor=4,7 -|1: New Term Find Grep Joincol D New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/ /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter Collapse -|3: cwd Term+bash Save Mode Filt Del -|4: er Collapse Del ls -|5: ls w.txt -|6: w.txt -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: /tmp/pardes-snap/cornerdrag/ -|18: cwd Term+bash Save Mode Filt -|19: er Collapse Del -|20: ls -|21: w.txt -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: -== snap corner-drag grid=100x31 cursor=4,7 -|1: New Term Find Grep Joincol D New Term Find Grep Joincol ╎elcol -|2: /tmp/pardes-snap/cornerdrag/ /tmp/pardes-snap/cornerdrag╎cwd Term+bash Save Mode Filter Collapse -|3: cwd Term+bash Save Mode Filt Del ╎ -|4: er Collapse Del ls ╎ -|5: ls w.txt ╎ -|6: w.txt ╎ -|7: ╎ -|8: ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -|9: ╎ -|10: ╎ -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: /tmp/pardes-snap/cornerdrag/ ╎ -|18: cwd Term+bash Save Mode Filt ╎ -|19: er Collapse Del ╎ -|20: ls ╎ -|21: w.txt ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap corner-done grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter /tmp/pardes-snap/cornerdrag/cwd Term+b -|3: Collapse Del ash Save Mode Filter Collapse Del -|4: ls ls -|5: w.txt w.txt -|6: -|7: -|8: -|9: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter -|10: Collapse Del -|11: ls -|12: w.txt -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: -== snap clamp-x grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol D╎lcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter /tmp/pardes-snap/cornerdrag/╎wd Term+b -|3: Collapse Del ash Save Mode Filter Collaps╎ Del -|4: ls ls ╎ -|5: w.txt w.txt ╎ -|6: ╎ -|7: ╎ -|8: ╎ -|9: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter ╎ -|10: Collapse Del ╎ -|11: ls ╎ -|12: w.txt ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: ╎ -|18: ╎ -|19: ╎ -|20: ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap clamp-y grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol ╎ New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filte╎ /tmp/pardes-snap/cornerdrag/cwd Term+b -|3: Collapse Del ╎ ash Save Mode Filter Collapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|6: ╎ -|7: ╎ -|8: ╎ -|9: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filte╎ -|10: Collapse Del ╎ -|11: ls ╎ -|12: w.txt ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: ╎ -|18: ╎ -|19: ╎ -|20: ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -|30: ╎ -== snap clamp-done grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter /tmp/pardes-snap/cornerdrag/cwd Term+b -|3: Collapse Del ash Save Mode Filter Collapse Del -|4: ls ls -|5: w.txt w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: -|24: -|25: -|26: -|27: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter -|28: Collapse Del -|29: w.txt -|30: diff --git a/test/snapshots/diffstack.golden b/test/snapshots/diffstack.golden new file mode 100644 index 00000000..51251c4c --- /dev/null +++ b/test/snapshots/diffstack.golden @@ -0,0 +1,61 @@ +== snap diff-stack grid=100x31 cursor=4,4 +| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit +| New Term Find Grep Joincol Delcol +|$ /tmp/pardes-snap/diffstack/cwd Term+bash Save Mode Filter Collapse Del +| $ cat change.patch | $(readlink /proc/$PPID/exe) - +| $ +| /tmp/pardes-snap/diffstack/cwd/+Diff Save Term Diff Collapse LocationsConfig Del +| a.zig:3 +| const S = struct { +| a.zig:5 * +| fn f() void { +| - c(); +| + a(); +| b(); +| + log(); +| } +| +| +| +| +| +| +| +| +| +| +| +| /tmp/pardes-snap/diffstack/cwd/+New Save Term Collapse Follow Del +| 1 +== style diff-stack-colours grid=100x31 +|0: 0-1 d,#1d2824, 2-99 #b2c3b8,#1d2824, +|1: 0-1 d,#887455, 2-99 #becfc4,#314738, +|2: 0-1 #000000,#add38a, 2-32 #becfc4,#314738, 33-42 #dfbce5,#314738, 43-99 #becfc4,#314738, +|3: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #e5eee5,#0d1410, +|4: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #e5eee5,#0d1410, +|5: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-38 #d3b0d9,#1d2824, 39-99 #b2c3b8,#1d2824, +|6: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #59675c,#0d1410, +|7: 0-0 d,#608269, 1-2 d,#0d1410, 3-99 #59675c,#0d1410, +|8: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #59675c,#0d1410, +|9: 0-0 d,#608269, 1-6 d,#0d1410, 7-9 #c9a7ed,#0d1410, 10-99 #e5eee5,#0d1410, +|10: 0-0 d,#608269, 1-1 d,#0d1410, 2-2 #f1a39b,#0d1410,b 3-10 #f1a39b,#0d1410, 11-11 #e5eee5,#453832, 12-99 #e5eee5,#0d1410, +|11: 0-0 d,#608269, 1-1 d,#0d1410, 2-2 #b6ce94,#0d1410,b 3-10 #b6ce94,#0d1410, 11-11 #e5eee5,#364131, 12-99 #e5eee5,#0d1410, +|12: 0-0 d,#608269, 1-10 d,#0d1410, 11-99 #e5eee5,#0d1410, +|13: 0-0 d,#608269, 1-1 d,#0d1410, 2-2 #b6ce94,#171f18,b 3-10 #b6ce94,#171f18, 11-99 #e5eee5,#171f18, +|14: 0-0 d,#608269, 1-6 d,#0d1410, 7-99 #e5eee5,#0d1410, +|15: 0-0 d,#608269, 1-99 d,#0d1410, +|16: 0-0 d,#608269, 1-99 d,#0d1410, +|17: 0-0 d,#608269, 1-99 d,#0d1410, +|18: 0-0 d,#608269, 1-99 d,#0d1410, +|19: 0-0 d,#608269, 1-99 d,#0d1410, +|20: 0-0 d,#608269, 1-99 d,#0d1410, +|21: 0-0 d,#608269, 1-99 d,#0d1410, +|22: 0-0 d,#608269, 1-99 d,#0d1410, +|23: 0-0 d,#608269, 1-99 d,#0d1410, +|24: 0-0 d,#608269, 1-99 d,#0d1410, +|25: 0-0 d,#608269, 1-99 d,#0d1410, +|26: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-37 #d3b0d9,#1d2824, 38-99 #b2c3b8,#1d2824, +|27: 0-0 d,#608269, 1-4 d,#0d1410, 5-99 #59675c,#0d1410, +|28: 0-0 d,#608269, 1-99 d,#0d1410, +|29: 0-0 d,#608269, 1-99 d,#0d1410, +|30: 0-0 d,#608269, 1-99 d,#0d1410, diff --git a/test/snapshots/shrinktag.golden b/test/snapshots/shrinktag.golden index d2167e86..bfca20e3 100644 --- a/test/snapshots/shrinktag.golden +++ b/test/snapshots/shrinktag.golden @@ -32,7 +32,6 @@ |19: |20: == snap move-preview grid=100x31 cursor=4,9 -|8: ls ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌▌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ == snap restored grid=100x31 cursor=4,9 |4: ls ls |5: w.txt w.txt diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden index 6d27586b..ab97a868 100644 --- a/test/snapshots/windowops.golden +++ b/test/snapshots/windowops.golden @@ -21,71 +21,9 @@ | ls | w.txt == snap hover-h grid=100x31 cursor=4,6 -== snap border-drag grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol ╎ New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Term+b╎sh Save Mo /tmp/pardes-snap/windowops/cwd Term+bash Save Mo -|3: de Filter Collapse Del ╎ de Filter Collapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|6: ╎ -|7: ╎ -|8: ╎ -|9: ╎ -|10: ╎ -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: /tmp/pardes-snap/windowops/cwd Term+b╎sh Save Mo -|18: de Filter Collapse Del ╎ -|19: ls ╎ -|20: w.txt ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap border-done grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Term+ba /tmp/pardes-snap/windowops/cwd Term+bash Save Mode Filter -|3: sh Save Mode Filter Collapse Del Collapse Del -|4: ls ls -|5: w.txt w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: /tmp/pardes-snap/windowops/cwd Term+ba -|18: sh Save Mode Filter Collapse Del -|19: ls -|20: w.txt -|21: -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: == snap hborder-done grid=100x31 cursor=4,6 -|13: /tmp/pardes-snap/windowops/cwd Term+ba -|14: sh Save Mode Filter Collapse Del +|13: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo +|14: de Filter Collapse Del |15: ls |16: w.txt |17: @@ -95,63 +33,63 @@ == snap move-preview grid=100x31 cursor=4,17 == snap moved grid=100x31 cursor=4,17 == snap altn grid=100x31 cursor=4,22 -|18: /tmp/pardes-snap/windowops/cwd Term+ba -|19: sh Save Mode Filter Collapse Del +|18: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo +|19: de Filter Collapse Del |20: ls |21: w.txt -== snap focus-right grid=100x31 cursor=44,6 -== snap debug-on grid=100x31 cursor=44,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep J╭────────────────────────────────────╮ -|2: /tmp/pardes-snap/windowops/cwd Term+ba /tmp/pardes-snap/win│pardes resizes=1 │ -|3: sh Save Mode Filter Collapse Del Collapse Del │theme orchard │ -|4: ls ls │font default │ -|5: w.txt w.txt │terms 4 cols 2 │ -|6: │active #2 58x27 │ +== snap focus-right grid=100x31 cursor=54,6 +== snap debug-on grid=100x31 cursor=54,6 +|1: New Term Find Grep Joincol Delcol New Term F╭────────────────────────────────────╮ +|2: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo /tmp/parde│pardes resizes=1 │ +|3: de Filter Collapse Del de Filter │theme orchard │ +|4: ls ls │font default │ +|5: w.txt w.txt │terms 4 cols 2 │ +|6: │active #2 48x27 │ |7: │scroll 0/27 │ |8: │frame virtual clock │ |9: │ │ |10: │ │ |11: │ │ |12: │ │ -|13: /tmp/pardes-snap/windowops/cwd Term+ba ╰────────────────────────────────────╯ +|13: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo ╰────────────────────────────────────╯ == style debug-on grid=100x31 |0: 0-1 d,#1d2824, 2-74 #b2c3b8,#1d2824, 75-79 #f5f7ee,#3c614a, 80-80 #f5f7ee,#1d2824, 81-99 #b2c3b8,#1d2824, -|1: 0-1 d,#887455, 2-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#887455, 42-61 #becfc4,#314738, 62-99 d,d, -|2: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-39 #d3b0d9,#1d2824, 40-41 #d3b0d9,#add38a, 42-61 #becfc4,#314738, 62-62 d,d, 63-79 #b2c3b8,d, 80-98 #b2c3b8,#152019, 99-99 d,d, -|3: 0-1 d,#1d2824, 2-4 #d3b0d9,#1d2824, 5-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#314738, 42-61 #becfc4,#314738, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, -|4: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-61 #e5eee5,#0d1410, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, -|5: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-61 #e5eee5,#0d1410, 62-62 d,d, 63-77 #b2c3b8,d, 78-98 #b2c3b8,#152019, 99-99 d,d, -|6: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-78 #b2c3b8,d, 79-98 #b2c3b8,#152019, 99-99 d,d, -|7: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-73 #b2c3b8,d, 74-98 #b2c3b8,#152019, 99-99 d,d, -|8: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-82 #b2c3b8,d, 83-98 #b2c3b8,#152019, 99-99 d,d, -|9: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|10: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|11: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|12: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|13: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-39 #d3b0d9,#1d2824, 40-40 #d3b0d9,#608269, 41-61 #d3b0d9,#0d1410, 62-99 d,d, -|14: 0-1 d,#1d2824, 2-4 #d3b0d9,#1d2824, 5-39 #b2c3b8,#1d2824, 40-40 #b2c3b8,#608269, 41-99 #b2c3b8,#0d1410, -|15: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|16: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|17: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|18: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-39 #d3b0d9,#1d2824, 40-40 #d3b0d9,#608269, 41-99 #d3b0d9,#0d1410, -|19: 0-1 d,#1d2824, 2-4 #d3b0d9,#1d2824, 5-39 #b2c3b8,#1d2824, 40-40 #b2c3b8,#608269, 41-99 #b2c3b8,#0d1410, -|20: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|21: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|22: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|23: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|24: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|25: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|26: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|27: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|28: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|29: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|30: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -== snap debug-off grid=100x31 cursor=44,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Term+ba /tmp/pardes-snap/windowops/cwd Term+bash Save Mode Filter -|3: sh Save Mode Filter Collapse Del Collapse Del -|4: ls ls Debug -|5: w.txt w.txt +|1: 0-1 d,#887455, 2-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#887455, 52-61 #becfc4,#314738, 62-99 d,d, +|2: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-42 #d3b0d9,#1d2824, 43-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#add38a, 52-61 #becfc4,#314738, 62-62 d,d, 63-79 #b2c3b8,d, 80-98 #b2c3b8,#152019, 99-99 d,d, +|3: 0-1 d,#1d2824, 2-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#314738, 52-61 #becfc4,#314738, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, +|4: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-61 #e5eee5,#0d1410, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, +|5: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-61 #e5eee5,#0d1410, 62-62 d,d, 63-77 #b2c3b8,d, 78-98 #b2c3b8,#152019, 99-99 d,d, +|6: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-78 #b2c3b8,d, 79-98 #b2c3b8,#152019, 99-99 d,d, +|7: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-73 #b2c3b8,d, 74-98 #b2c3b8,#152019, 99-99 d,d, +|8: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-82 #b2c3b8,d, 83-98 #b2c3b8,#152019, 99-99 d,d, +|9: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|10: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|11: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|12: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|13: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-42 #d3b0d9,#1d2824, 43-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-61 #b2c3b8,#0d1410, 62-99 d,d, +|14: 0-1 d,#1d2824, 2-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-99 #b2c3b8,#0d1410, +|15: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|16: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|17: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|18: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-42 #d3b0d9,#1d2824, 43-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-99 #b2c3b8,#0d1410, +|19: 0-1 d,#1d2824, 2-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-99 #b2c3b8,#0d1410, +|20: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|21: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|22: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|23: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|24: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|25: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|26: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|27: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|28: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|29: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|30: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +== snap debug-off grid=100x31 cursor=54,6 +|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol +|2: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo /tmp/pardes-snap/windowops/cwd Term+bash Save Mo +|3: de Filter Collapse Del de Filter Collapse Del +|4: ls ls Debug +|5: w.txt w.txt |6: |7: |8: @@ -159,4 +97,4 @@ |10: |11: |12: -|13: /tmp/pardes-snap/windowops/cwd Term+ba +|13: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo diff --git a/test/soak.py b/test/soak.py index 401cb84e..faf447ab 100644 --- a/test/soak.py +++ b/test/soak.py @@ -148,6 +148,15 @@ def fixture(at, rng): sub.mkdir(exist_ok=True) (sub / 'inner.txt').write_text(''.join(f'inner {i} {rng.choice(WORDS)}\n' for i in range(60))) (sub / 'more.md').write_text('# More\n\n' + ''.join(f'- item {i} {rng.choice(WORDS)}\n' for i in range(40))) + # A repository whose last commit changes code.zig, for act_gitshow. + if shutil.which('git'): + git = ['git', '-c', 'user.name=soak', '-c', 'user.email=soak@invalid', '-c', 'init.defaultBranch=main'] + subprocess.run(git + ['init', '-q'], cwd=at, check=True) + subprocess.run(git + ['add', 'code.zig'], cwd=at, check=True) + subprocess.run(git + ['commit', '-qm', 'code'], cwd=at, check=True) + code = (at / 'code.zig').read_text().replace('return x * 7 +', 'return x * 8 +').replace('pub fn f9(', 'pub fn nine(') + (at / 'code.zig').write_text(code) + subprocess.run(git + ['commit', '-qam', 'change'], cwd=at, check=True) # ---- terminals ---- @@ -681,6 +690,16 @@ def act_shell(c, rng, k): k(rng.choice([b'k', b'j', b''])) +def act_gitshow(c, rng, k): + # A commit paged into `pardes -` (git's pager): the +Pager restacked into + # a +Diff, whose rows come from the files the step reads (hunks.zig). + k(b' nt') + time.sleep(rng.uniform(0.8, 1.5)) + k(b'git show HEAD | "$(readlink /proc/$PPID/exe)" -\r') + time.sleep(rng.uniform(1.0, 2.0)) + k(b'\x02') + + def act_window(c, rng, k): # Enter ends window mode, as a person would: left open, it took the next # action's keys, and a `k` at a column's top went to its tag, where `SPC q` ran Exit @@ -762,7 +781,7 @@ ACTIONS = [ ('panes', 3, act_panes), ('find', 3, act_find), ('shell', 3, act_shell), ('window', 4, act_window), ('column', 1, act_column), ('del', 2, act_del), ('new', 2, act_new), ('esc', 4, act_esc), ('click', 8, act_click), ('wheel', 8, act_wheel), ('hover', 6, act_hover), ('paste', 2, act_paste), - ('settings', 1, act_settings), ('idle', 6, act_idle), + ('settings', 1, act_settings), ('gitshow', 1, act_gitshow), ('idle', 6, act_idle), ] |
