diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 23:58:16 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | fa504c392b5f3c04a7cfce74566e23cb94ddd6cf (patch) | |
| tree | 71dbd6320f6238c07deb23e5727b4c5afd96a61f /test/process/tty_editing.zig | |
| parent | 162d7ec610b770c27b9a7c481f66c6f2e4898bd5 (diff) | |
| download | pardes-fa504c392b5f3c04a7cfce74566e23cb94ddd6cf.tar.gz pardes-fa504c392b5f3c04a7cfce74566e23cb94ddd6cf.zip | |
test: a +Diff pinned before it moves: process-test's `diffstack` pages a patch into `pardes -` and snaps the +Diff it is restacked into (its hunk found two lines down where the file moved it, under the declaration it stands in, `a.zig:3` and `const S = struct {`, its label one level deep, `a.zig:5 *`; the changed word on a stronger ground in both lines, a line added whole on a faint one, the markers in their tints' hue), as text and as styles; replicas opens with a .patch looked at by the authority and as the replica's own input, the first stopped at its first read and confirmed with no rollback, the replica's digest and +Diff the authority's either way; the soak's fixture is a repository whose last commit changes code.zig, and `gitshow` pages `git show HEAD` into `pardes -` from a shell
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/process/tty_editing.zig')
| -rw-r--r-- | test/process/tty_editing.zig | 24 |
1 files changed, 24 insertions, 0 deletions
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 |
