summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 20:33:01 -0300
committerGabriel Schneider <[email protected]>2026-11-24 20:33:01 -0300
commitabe3817e8dd0af41e6b5786bdbeb631219b58c23 (patch)
treed2db2ba07f1b8ee743926aa87b8c25070f72fcb6 /test
parent480f36b85299fa7407c20a2d6482dd093f842bf7 (diff)
downloadpardes-abe3817e8dd0af41e6b5786bdbeb631219b58c23.tar.gz
pardes-abe3817e8dd0af41e6b5786bdbeb631219b58c23.zip
Prompt: a body's text prompts ask in its tag's head (walk UI, pick-ui SPEC.md §7.1, §7.2, item 1 of line E): `s S K A-K | A-| ! A-! $` from a body are a typing state of the view's tag (TagState.Kind.prompt, its state Prompt.zig, its field A's Field), drawn after the prefix in place of the tag's own text (R1): box `^`, the prompt's key cell, the field, the plain word it stands for (`= Exec Edit x/self/`, `Edit g/re/`, `Edit |tr a-z A-Z`, `Edit >cmd`; none for `! A-! $`), its count (`2 selections in 3 lines`, `keeps 1 of 2`, `0` for no match, the selections it began with back), the hints; the live machinery as it was (normal.applySelRegex, now returning what it found; the pipe off the loop, Pipe.submit split from the notice band's submitPipe); a pattern that is no regex changes nothing, the last result drawn dimmed (body_layer) and the reason at the count's place in the error ink (TagState.Style.err, regexp's message); Up/Down recall the history inline, Ctrl-r unrolls it as a band step filtered by the field (three session histories, Pardes.prompt_history: search and select's, the pipes', the command line's, 16 lines each, in the digest and the dump); Esc and Backspace on an empty field put the body back; Enter keeps the line in its history and the pattern in `/`, the command in `|`; a paste goes into the field; a prompt for a tag's or a header's text, Save's path, a terminal's `/` still ask on the notice band; wire 37; TEST FIRST: Prompt.zig "s asks in the tag's head ..." and "Enter keeps what s found ... a pipe from the body asks in the tag and runs off the loop"; Pipe.zig's and panes.zig's prompt tests and test/behaviour/keys.zig's two read the head; goldens pipe, selregex, msg (the prompt in the tag head, no chip); core-test 1014/1180 (166 skipped), shell-test 1227/1230, pane-test 182/184 (the 1 failure A's: `SPC h ?` is Help in the tag now), behaviour-test 274/277 (the 3 failures A's: window mode's head, a struck leader key), process-test the 6 of A's report plus none of mine, term-test 17/17, kitty-test 45/45
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/behaviour/keys.zig18
-rw-r--r--test/daemon.py2
-rw-r--r--test/snapshots/msg.golden14
-rw-r--r--test/snapshots/pipe.golden6
-rw-r--r--test/snapshots/selregex.golden27
5 files changed, 38 insertions, 29 deletions
diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig
index e1f550e3..e8731d2c 100644
--- a/test/behaviour/keys.zig
+++ b/test/behaviour/keys.zig
@@ -14,18 +14,20 @@ test "keys: a prompt's entry and cancellation leave the tag, the body and its cu
const dot = s.at("/pane/{d}/dot", .{n});
try s.replace(tag, " keep");
for ([_]struct { keys: []const u8, shown: []const u8 }{
- .{ .keys = "s", .shown = " /zq" },
- .{ .keys = "|", .shown = " |zq" },
- .{ .keys = alt ++ "|", .shown = " |-zq" },
- .{ .keys = "!", .shown = " !zq" },
- .{ .keys = alt ++ "!", .shown = " !+zq" },
+ .{ .keys = "s", .shown = " s zq" },
+ .{ .keys = "|", .shown = " | zq" },
+ .{ .keys = alt ++ "|", .shown = " A-| zq" },
+ .{ .keys = "!", .shown = " ! zq" },
+ .{ .keys = alt ++ "!", .shown = " A-! zq" },
}) |case| {
try s.write(dot, "6 6");
try s.keys(case.keys);
- // The answer is typed into the prompt's own line, never the tag.
+ // The answer is typed into the tag's head (walk UI), shown in place
+ // of the tag's own text, which it never touches.
try s.keys("zq");
_ = try s.where(case.shown);
- try std.testing.expectEqualStrings("/test.txt keep", try s.read(tag));
+ const head = try s.read(tag);
+ try std.testing.expect(std.mem.startsWith(u8, head, "/test.txt") and std.mem.startsWith(u8, head["/test.txt".len..], case.shown));
try s.keys("\x1b");
try std.testing.expectError(error.NotOnScreen, s.where(case.shown));
try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{n})), " mode:normal "));
@@ -56,8 +58,8 @@ test "keys: a prompt opens whatever the tag already holds" {
try s.keys(key);
try s.keys("zq");
_ = try s.where("zq");
- try std.testing.expectEqualStrings(full, try s.read(tag));
try s.keys("\x1b");
+ try std.testing.expectEqualStrings(full, try s.read(tag));
}
}
diff --git a/test/daemon.py b/test/daemon.py
index f9cbc9e1..4bc2658f 100644
--- a/test/daemon.py
+++ b/test/daemon.py
@@ -340,7 +340,7 @@ class Replica:
"""A replica's connection (abi/wire.zig): length-prefixed
messages, a tag byte and a little-endian u32 length. It is a near
client: its first word after the hello says so."""
- WIRE = 36
+ WIRE = 37
def __init__(self, path, timeout=10):
self.path, self.timeout = path, timeout
diff --git a/test/snapshots/msg.golden b/test/snapshots/msg.golden
index 7f83cacf..6a79cd68 100644
--- a/test/snapshots/msg.golden
+++ b/test/snapshots/msg.golden
@@ -36,14 +36,18 @@
|7:
|8:
|9:
-== snap prompt grid=70x17 cursor=69,3
-|3: 1 EXTERNAL Select /EXT
-== snap prompt-wins grid=70x17 cursor=69,4
-|3: 1 AGAIN --:--:-- reloaded /tmp/pardes-snap/msg/cwd/a.txt
-|4: ~ Select /EXT
+== snap prompt grid=70x17 cursor=38,2
+|2: ^ /tmp/pardes-snap/msg/cwd/a.txt s EXT = Exec Edit x/EXT/ 0 ⏎ sel
+|3: ect · C-r history · esc
+|4: 1 EXTERNAL
+|5: ~
+== snap prompt-wins grid=70x17 cursor=38,2
+|4: 1 AGAIN --:--:-- reloaded /tmp/pardes-snap/msg/cwd/a.txt
== snap esc grid=70x17 cursor=7,4
+|2: /tmp/pardes-snap/msg/cwd/a.txt Save Term Collapse Follow Del
|3: 1 AGAIN
|4: ~
+|5:
== snap msgbuiltin grid=70x17 cursor=29,5
|2: */tmp/pardes-snap/msg/cwd/a.txt Save Term Collapse Follow Del
|3: 1 AGAIN hand-written report
diff --git a/test/snapshots/pipe.golden b/test/snapshots/pipe.golden
index 618a3019..641418f9 100644
--- a/test/snapshots/pipe.golden
+++ b/test/snapshots/pipe.golden
@@ -1,8 +1,8 @@
-== snap prompt grid=180x13 cursor=179,3
+== snap prompt grid=180x13 cursor=49,2
| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit
| New Term Find Grep Joincol Delcol
-| /tmp/pardes-snap/pipe/cwd/pipe.txt Save Term Collapse Follow Del
-| 1 alpha beta |tr a-z A-Z
+|^ /tmp/pardes-snap/pipe/cwd/pipe.txt | tr a-z A-Z = Exec Edit |tr a-z A-Z ⏎ replace · C-r history · esc
+| 1 alpha beta
| 2 gamma delta
== snap filtered grid=180x13 cursor=17,3
|2: */tmp/pardes-snap/pipe/cwd/pipe.txt Save Term Collapse Follow Del
diff --git a/test/snapshots/selregex.golden b/test/snapshots/selregex.golden
index 4e456d99..cc460f03 100644
--- a/test/snapshots/selregex.golden
+++ b/test/snapshots/selregex.golden
@@ -1,18 +1,18 @@
-== snap prompt-armed grid=160x25 cursor=159,3
+== snap prompt-armed grid=160x25 cursor=40,2
| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit
| New Term Find Grep Joincol Delcol
-| /tmp/pardes-snap/selregex/cwd/m.zig Save Term Collapse Follow TreeContext Def Refs Del
-| 1 const one = 1; Select /
+|^ /tmp/pardes-snap/selregex/cwd/m.zig s ⏎ select · C-r history · esc
+| 1 const one = 1;
| 2 const two = 2;
| 3 const three = 3;
| ~
-== snap preview grid=160x25 cursor=159,3
-|3: 1 const one = 1; Select /const
+== snap preview grid=160x25 cursor=45,2
+|2: ^ /tmp/pardes-snap/selregex/cwd/m.zig s const = Exec Edit x/const/ 3 selections in 3 lines ⏎ select · C-r history · esc
== style preview grid=160x25
|0: 0-1 d,#1d2824, 2-159 #b2c3b8,#1d2824,
|1: 0-1 d,#887455, 2-159 #becfc4,#314738,
-|2: 0-1 d,#add38a, 2-31 #becfc4,#314738, 32-37 #dfbce5,#314738, 38-159 #becfc4,#314738,
-|3: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #f5f7ee,#3c614a, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-143 #e5eee5,#0d1410, 144-145 #e5eee5,#1d2824, 146-159 #b2c3b8,#1d2824,
+|2: 0-1 #000000,#add38a, 2-31 #becfc4,#314738, 32-37 #dfbce5,#314738, 38-38 #add38a,#314738,b 39-39 #add38a,#314738, 40-44 #becfc4,#314738, 45-52 #becfc4,#314738,f 53-95 #becfc4,#314738, 96-123 #becfc4,#314738,f 124-159 #becfc4,#314738,
+|3: 0-0 d,#608269, 1-1 d,#0d1410, 2-4 d,#0d1410,b 5-6 #616f64,#0d1410,b 7-10 #f5f7ee,#3c614a, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-159 #e5eee5,#0d1410,
|4: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #f5f7ee,#243a2d, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-159 #e5eee5,#0d1410,
|5: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #f5f7ee,#243a2d, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-20 #e5eee5,#0d1410, 21-21 #f8c082,#0d1410, 22-159 #e5eee5,#0d1410,
|6: 0-0 d,#608269, 1-4 d,#0d1410, 5-159 #59675c,#0d1410,
@@ -35,18 +35,21 @@
|23: 0-0 d,#608269, 1-159 d,#0d1410,
|24: 0-0 d,#608269, 1-159 d,#0d1410,
== snap three-selected grid=160x25 cursor=11,3
-|3: 1 const one = 1;
+|2: /tmp/pardes-snap/selregex/cwd/m.zig Save Term Collapse Follow TreeContext Def Refs Del
== style three-selected grid=160x25
+|2: 0-1 d,#add38a, 2-31 #becfc4,#314738, 32-37 #dfbce5,#314738, 38-159 #becfc4,#314738,
|3: 0-0 d,#608269, 1-1 d,#0d1410, 2-4 d,#0d1410,b 5-6 #616f64,#0d1410,b 7-11 #f5f7ee,#3c614a, 12-12 #f5f7ee,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-159 #e5eee5,#0d1410,
-== snap narrowed grid=160x25 cursor=159,3
-|3: 1 const one = 1; Select /t
+== snap narrowed grid=160x25 cursor=41,2
+|2: ^ /tmp/pardes-snap/selregex/cwd/m.zig s t = Exec Edit x/t/ 3 selections in 3 lines ⏎ select · C-r history · esc
== style narrowed grid=160x25
-|3: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #e5eee5,#0d1410, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-147 #e5eee5,#0d1410, 148-149 #e5eee5,#1d2824, 150-159 #b2c3b8,#1d2824,
+|2: 0-1 #000000,#add38a, 2-31 #becfc4,#314738, 32-37 #dfbce5,#314738, 38-38 #add38a,#314738,b 39-39 #add38a,#314738, 40-40 #becfc4,#314738, 41-48 #becfc4,#314738,f 49-87 #becfc4,#314738, 88-115 #becfc4,#314738,f 116-159 #becfc4,#314738,
+|3: 0-0 d,#608269, 1-1 d,#0d1410, 2-4 d,#0d1410,b 5-6 #616f64,#0d1410,b 7-10 #e5eee5,#0d1410, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-159 #e5eee5,#0d1410,
|4: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #e5eee5,#0d1410, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-159 #e5eee5,#0d1410,
|5: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #e5eee5,#0d1410, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-20 #e5eee5,#0d1410, 21-21 #f8c082,#0d1410, 22-159 #e5eee5,#0d1410,
== snap esc-restores grid=160x25 cursor=11,3
-|3: 1 const one = 1;
+|2: /tmp/pardes-snap/selregex/cwd/m.zig Save Term Collapse Follow TreeContext Def Refs Del
== style esc-restores grid=160x25
+|2: 0-1 d,#add38a, 2-31 #becfc4,#314738, 32-37 #dfbce5,#314738, 38-159 #becfc4,#314738,
|3: 0-0 d,#608269, 1-1 d,#0d1410, 2-4 d,#0d1410,b 5-6 #616f64,#0d1410,b 7-11 #f5f7ee,#3c614a, 12-12 #f5f7ee,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-159 #e5eee5,#0d1410,
|4: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #f5f7ee,#243a2d, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-18 #e5eee5,#0d1410, 19-19 #f8c082,#0d1410, 20-159 #e5eee5,#0d1410,
|5: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-10 #f5f7ee,#243a2d, 11-11 #3c614a,#f5f7ee, 12-12 #3c614a,#0d1410, 13-20 #e5eee5,#0d1410, 21-21 #f8c082,#0d1410, 22-159 #e5eee5,#0d1410,