diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-25 12:00:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 12:09:48 -0300 |
| commit | 8af71053adc306b81c39429d6d1758bb6c81d363 (patch) | |
| tree | 4f4dd30cfba4db91da523104025fe544d2fc1a6b /test | |
| parent | 40f4750dc3fe870349c13649d22b4687896bbf7b (diff) | |
| parent | ae138cd257f862f226f3f9561b98b7c0518bfcf5 (diff) | |
| download | pardes-8af71053adc306b81c39429d6d1758bb6c81d363.tar.gz pardes-8af71053adc306b81c39429d6d1758bb6c81d363.zip | |
walk UI M7: the fix round's X1 (lrzulkwu 40f4750dc3fe: band rows in the dumps and the digest (the soak's `views[0].rects` class), a picker's band capped at 40 % of its host pane at open E5.1, the band under the head E5.2, the notice row cut with `…` E5.4, a blank each side of a step's rule E5.5, Help's chord and word with its group as right-aligned meta E5.6, a doc with no room on the notice row E5.10, full-height `│` in the window E5.9, the tag rule under a band over a terminal E5.11) merged with X2 (suvlqwul ae138cd257f8: the soak typist's q guard, a message's detail only on request E5.3/D13, the err role's fallback E5.7, ` · N lines` kept dim after a search's count (E7's reversal of E5.8), a list of places in one column with its places dim E7 2b, the landing line at 1.5:1 and its span at 1.9:1 E7 7b, code actions Enter cannot apply dim with meta `command`/`other files` E5.12), both on G4's lurxouvq, resolved by meaning: the only text conflict was test/snapshots/fsearch.golden; Messages.noticeRow (X1's left-text cut and doc line, its `*Pardes` signature) and X2's D13 (detailUnder, detailAt, act, rollUp) touch different functions and merged clean, as did Core.zig (X1's sync, X2's updateInner arms) and Pick.zig (X1's `cap` and bandRows, X2's rowAt actions arm and steps' place column); BY MEANING: X1's E3 rule gives the band's last list step the remaining width, so X2's place column (padded to the widest place shown, Pick.steps) is no longer cut at 52 cells and still lines up (a row with a place is cut from the right by Band.cutRow, its `pre` set, so the column never shifts), and the actions picker's one step is the band's width, so its meta `command`/`other files` stands at the band's right end (X2's reading 8 asked for exactly that); TESTS (the merge's checks): Pick "a list of places ..." also asks the band's drawn rows (Band.of, band.line): the last step ends at the band's edge and the two rows' code in one column; Pick "code actions: a row that cannot be applied ..." also asks the band's first row to end ` command` at the band's width; GOLDEN: fsearch regenerated and every changed row read: against X1 only X2's rows (`g.txt:2:1: MARK a` and `6:1: MARK b` padded to `10:1: MARK c`'s column in list and ctrln, row 16's ` · N lines` cells in the dim ink); against X2 only X1's (the band from the row under the head, the reader borrowing a row so its body shows line 9 / 11, the stray `│` under the `/` prompt gone); no other golden moved; core-test 1095/1266 (171 skipped; X1 1090/1261 + X2 1088/1259 over the base's 1083/1254), the two extended tests filtered 11/11 each; process-test 1 of 147 failed before the update (fsearch, the conflicted golden) and fsearch 0 of 1 after it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'test')
| -rw-r--r-- | test/replicas.zig | 31 | ||||
| -rw-r--r-- | test/snapshots/fsearch.golden | 10 | ||||
| -rw-r--r-- | test/snapshots/lsp.golden | 4 |
3 files changed, 32 insertions, 13 deletions
diff --git a/test/replicas.zig b/test/replicas.zig index cd0a3459..65e6a0ba 100644 --- a/test/replicas.zig +++ b/test/replicas.zig @@ -334,12 +334,11 @@ fn nextEvent(random: std.Random, buf: *[64]u8, aim: Aim, looks: []const []const 0...15 => { buf[0] = typed[random.uintLessThan(usize, typed.len)]; if (buf[0] == 'q' and script.space) buf[0] = 'r'; - script.space = buf[0] == ' '; + script.space = script.space or buf[0] == ' '; return .{ .key = .{ .cp = buf[0], .text = buf[0..1] } }; }, 16...27 => { buf[0] = normal[random.uintLessThan(usize, normal.len)]; - script.space = false; return .{ .key = .{ .cp = buf[0], .text = buf[0..1] } }; }, 28...31 => { @@ -393,7 +392,7 @@ fn nextEvent(random: std.Random, buf: *[64]u8, aim: Aim, looks: []const []const // A search in the pane with the keyboard (a PDF's `/` is its own): // `/`, a pattern, Enter. 41 => { - script.* = .{ .n = 2, .evs = .{ .{ .paste = ([_][]const u8{ "the", "view", "pardes" })[random.uintLessThan(usize, 3)] }, .{ .key = .{ .cp = Key.enter } }, undefined } }; + script.* = .{ .n = 2, .evs = .{ .{ .paste = ([_][]const u8{ "the", "view", "pardes" })[random.uintLessThan(usize, 3)] }, .{ .key = .{ .cp = Key.enter } }, undefined }, .space = script.space }; return .{ .key = .{ .cp = '/', .text = "/" } }; }, // A sweep of B1 over the PDF: a selection (or a page's pan, or nothing). @@ -403,7 +402,7 @@ fn nextEvent(random: std.Random, buf: *[64]u8, aim: Aim, looks: []const []const const y = at[1] + random.uintLessThan(u16, at[3]); const x1 = at[0] + random.uintLessThan(u16, at[2]); const y1 = @min(at[1] + at[3] - 1, y + random.uintLessThan(u16, 3)); - script.* = .{ .n = 2, .evs = .{ .{ .mouse = .{ .button = .left, .kind = .drag, .col = x1, .row = y1 } }, .{ .mouse = .{ .button = .left, .kind = .release, .col = x1, .row = y1 } }, undefined } }; + script.* = .{ .n = 2, .evs = .{ .{ .mouse = .{ .button = .left, .kind = .drag, .col = x1, .row = y1 } }, .{ .mouse = .{ .button = .left, .kind = .release, .col = x1, .row = y1 } }, undefined }, .space = script.space }; return .{ .mouse = .{ .button = .left, .kind = .press, .col = x, .row = y } }; }, // The wheel over the shell, which scrolls its history into view, @@ -426,8 +425,10 @@ const Script = struct { evs: [3]pardes.Event = undefined, n: u8 = 0, at: u8 = 0, - /// Its last key was a space: Space then q is Exit (config.zig's - /// leader), which ends the session and the run with it. + /// A space typed and no Esc since: SPC's level may be open (it stays + /// over a key it has no child for, keys.zig `leaderKey`, and Backspace + /// takes it back up), and q in it is Exit (config.zig's leader), which + /// ends the session and the run with it. space: bool = false, }; @@ -3664,3 +3665,21 @@ fn corpusCase(dir: []const u8) !bool { std.debug.print("corpus through a client: {d} scenes, the own frontend drew {d} frames and the client {d}; {s}\n", .{ steps.len, own_host.shown.frames, shows.shown.frames, if (ok) "every scene's frame the same" else "FAILED" }); return ok; } + +test "the typist types no q while a leader its space opened may be open: from its space to its next Esc (SPC 7 o q was Exit)" { + var prng: std.Random.DefaultPrng = .init(109); + var script: Script = .{}; + var buf: [64]u8 = undefined; + // SPC's level stays open over a key it has no child for (keys.zig + // `leaderKey`), and Backspace takes it back up: Esc is the typist's + // one key sure to leave it. + var open = false; + for (0..200_000) |_| switch (nextEvent(prng.random(), &buf, .{ .shell = null, .pdf = null }, &.{"Look"}, &script, false, true)) { + .key => |k| { + if (open and k.cp == 'q') return error.TestUnexpectedResult; + if (k.cp == ' ') open = true; + if (k.cp == Key.escape) open = false; + }, + else => {}, + }; +} diff --git a/test/snapshots/fsearch.golden b/test/snapshots/fsearch.golden index 596f4fa9..8fbf0221 100644 --- a/test/snapshots/fsearch.golden +++ b/test/snapshots/fsearch.golden @@ -52,7 +52,7 @@ |13: 0-0 d,#608269, 1-89 d,#0d1410, 90-90 d,#608269, 91-179 d,#0d1410, |14: 0-0 d,#608269, 1-89 d,#0d1410, 90-90 d,#608269, 91-179 d,#0d1410, |15: 0-0 d,#608269, 1-89 d,#0d1410, 90-90 d,#608269, 91-179 d,#0d1410, -|16: 0-1 d,#496656, 2-30 #b2c3b8,#1d2824, 31-40 #d3b0d9,#1d2824, 41-89 #b2c3b8,#1d2824, 90-91 #000000,#add38a, 92-98 #becfc4,#2c2c0f, 99-99 #bada9d,#2c2c0f,b 100-100 #bada9d,#2c2c0f, 101-106 #becfc4,#2c2c0f, 107-113 #79836f,#2c2c0f, 114-137 #becfc4,#2c2c0f, 138-179 #79836f,#2c2c0f, +|16: 0-1 d,#496656, 2-30 #b2c3b8,#1d2824, 31-40 #d3b0d9,#1d2824, 41-89 #b2c3b8,#1d2824, 90-91 #000000,#add38a, 92-98 #becfc4,#2c2c0f, 99-99 #bada9d,#2c2c0f,b 100-100 #bada9d,#2c2c0f, 101-106 #becfc4,#2c2c0f, 107-113 #79836f,#2c2c0f, 114-126 #becfc4,#2c2c0f, 127-179 #79836f,#2c2c0f, |17: 0-0 d,#608269, 1-1 d,#0d1410, 2-89 #e5eee5,#0d1410, 90-90 #e5eee5,#608269, 91-94 #e5eee5,#0d1410, 95-96 #59675c,#0d1410, 97-179 #e5eee5,#0d1410, |18: 0-0 d,#608269, 1-1 d,#0d1410, 2-89 #e5eee5,#0d1410, 90-90 #e5eee5,#e5eee5, 91-91 #e5eee5,#0d1410, 92-94 #e5eee5,#0d1410,b 95-95 #616f64,#0d1410,b 96-96 #bada9d,#0d1410,b 97-100 #f5f7ee,#3c614a, 101-101 #f5f7ee,#0d1410, 102-179 #e5eee5,#0d1410, |19: 0-0 d,#608269, 1-89 d,#0d1410, 90-90 d,#608269, 91-94 d,#0d1410, 95-96 #59675c,#0d1410, 97-179 #e5eee5,#0d1410, @@ -70,8 +70,8 @@ == snap list grid=180x31 cursor=110,15 |15: ^ ‹@p1 › ␣ l /MARK/ 1/3 |16: /tmp/pardes-snap/fsearch/cwd Term+bash Save Mode Filter Collapse Del │ │ Walk Look Split Newcol Grep Edit Copy Keep Drop | Find Grep Recent Panes … -|17: ls │ │ ▶ /tmp/pardes-snap/fsearch/cwd/g.txt:2:1: MARK a -|18: g.txt │ │ /tmp/pardes-snap/fsearch/cwd/g.txt:6:1: MARK b +|17: ls │ │ ▶ /tmp/pardes-snap/fsearch/cwd/g.txt:2:1: MARK a +|18: g.txt │ │ /tmp/pardes-snap/fsearch/cwd/g.txt:6:1: MARK b |19: │ │ /tmp/pardes-snap/fsearch/cwd/g.txt:10:1: MARK c |20: │ │ |21: 1 l1 @@ -86,8 +86,8 @@ |30: ⏎ lands here · its text is the preview · S-⏎ a new pane 1 message · SPC h m == snap ctrln grid=180x31 cursor=110,15 |15: ^ ‹@p1 › ␣ l /MARK/ 2/3 -|17: ls │ │ /tmp/pardes-snap/fsearch/cwd/g.txt:2:1: MARK a -|18: g.txt │ │ ▶ /tmp/pardes-snap/fsearch/cwd/g.txt:6:1: MARK b +|17: ls │ │ /tmp/pardes-snap/fsearch/cwd/g.txt:2:1: MARK a +|18: g.txt │ │ ▶ /tmp/pardes-snap/fsearch/cwd/g.txt:6:1: MARK b |21: 3 l3 |22: 4 l4 |23: 5 l5 diff --git a/test/snapshots/lsp.golden b/test/snapshots/lsp.golden index 5d536a0f..c680700d 100644 --- a/test/snapshots/lsp.golden +++ b/test/snapshots/lsp.golden @@ -59,8 +59,8 @@ == snap symbols grid=120x41 cursor=24,2 |2: ^ a.zig:8 › ␣ l Symbols 1/3 |3: │ │ Walk Look Split Newcol Grep Edit Copy Keep Drop | Find Grep Recent Panes Symbols All Jumplist -|4: │ │ ▶ a.zig:1:7-9 std -|5: │ │ a.zig:3:4-9 helper +|4: │ │ ▶ a.zig:1:7-9 std +|5: │ │ a.zig:3:4-9 helper |6: │ │ a.zig:7:8-11 main |7: │ │ |8: 1▸const std = @import("std"); |
