diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 19:59:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 19:59:30 -0300 |
| commit | 68155195b3b968682a29392bdc5e5d3ad8c9d0a6 (patch) | |
| tree | a88c10b41d6c96b75f859c6a9d40a3d7b5ecc676 /test/behaviour | |
| parent | 173b0b8a4c854715e8bb697efc5c066927b7b671 (diff) | |
| download | pardes-68155195b3b968682a29392bdc5e5d3ad8c9d0a6.tar.gz pardes-68155195b3b968682a29392bdc5e5d3ad8c9d0a6.zip | |
TagState: a root struck in a pump wakes the loop for the frame that dates it (a fix on top of item 2, uqopxwqz, frozen), and the pane and behaviour tests that read the old leader: THE FAULT: a pump advances its clock before it settles its keys (Pardes.pump), so a root's key leaves its delay undated (TagState.asked) and TagState.wake left an undated root out, as nextWake leaves Del's question's: with nothing else due the loop slept until the next key and the level never showed (the process suite's find snapshot drew ` ␣ f …` after 400 ms still); a user hit it at every SPC, g, z, m, [, ], C-w and " in a terminal or a window; THE FIX: an undated root asks for the next frame (TagState.wake), whose advance dates it, then for its level's time; TEST FIRST: TagState.zig "a root struck in a pump, after its advance, wakes the loop for the next frame, which dates it, then for its level" (on uqopxwqz's wake: nextWake null after the key); the tests of the old behaviour: test/panes.zig's generated Help replaced by `Help h`, the word (SPC h ? is Help in the tag), test/behaviour/modes.zig's window mode (the pane with the keyboard shows window mode's head after its name, not its own words: looked for as `name `), test/behaviour/keys.zig's PDF (the leader's cell `␣` in the tag, not the SPC chip; a key the PDF takes still takes the leader away); behaviour-test 277 of 277 with these
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/behaviour')
| -rw-r--r-- | test/behaviour/keys.zig | 7 | ||||
| -rw-r--r-- | test/behaviour/modes.zig | 12 |
2 files changed, 11 insertions, 8 deletions
diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig index e1f550e3..78503dec 100644 --- a/test/behaviour/keys.zig +++ b/test/behaviour/keys.zig @@ -375,11 +375,12 @@ test "keys: a PDF in normal mode keeps : (its tag and back), SPC (a leader, canc try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{n})), " mode:normal ")); try s.keys(":"); try std.testing.expect(try s.cursor() == null); - // The leader shows its keys until one it has not. + // The leader shows its key cell in the tag at once (walk UI) until a + // key the PDF takes, which takes the leader away. try s.keys(" "); - try std.testing.expect(std.mem.indexOf(u8, try s.screen(), " SPC") != null); + try std.testing.expect(std.mem.indexOf(u8, try s.screen(), " ␣ ") != null); try s.keys("!"); - try std.testing.expect(std.mem.indexOf(u8, try s.screen(), " SPC") == null); + try std.testing.expect(std.mem.indexOf(u8, try s.screen(), " ␣ ") == null); try s.keys("/"); try std.testing.expect(try s.cursor() != null); try std.testing.expectEqual(n, try s.focused()); diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig index e615920d..a50cfb0e 100644 --- a/test/behaviour/modes.zig +++ b/test/behaviour/modes.zig @@ -118,11 +118,13 @@ fn threePanes(s: *Session) ![3]u32 { return .{ a, b, c }; } -/// The panes whose tag (`name Save`) is drawn in `lit`, the outline's colour. +/// The panes whose tag (`name `: the pane with the keyboard shows window +/// mode's head after its name, the others their own words) is drawn in +/// `lit`, the outline's colour. fn outlined(s: *Session, lit: []const u8, names: []const []const u8) ![]const u8 { var found: []const u8 = ""; for (names) |name| { - const x, const y = try s.where(s.at("{s} Save", .{name})); + const x, const y = try s.where(s.at("{s} ", .{name})); if (std.mem.eql(u8, lit, try s.bg(x, y))) found = s.at("{s}{s}", .{ found, name }); } return found; @@ -134,7 +136,7 @@ test "modes: Ctrl-w outlines a pane, h j k l move the outline, and Enter, Esc, : const a, const b, const c = try threePanes(&s); const names = &[_][]const u8{ "/a.txt", "/b.txt", "/c.txt" }; try s.keys("\x17"); - const x, const y = try s.where("/a.txt Save"); + const x, const y = try s.where("/a.txt "); const lit = try s.bg(x, y); try std.testing.expectEqualStrings("/a.txt", try outlined(&s, lit, names)); // Each pane's box shows its letter: the left column's is a. @@ -198,7 +200,7 @@ test "modes: in window mode d deletes the outlined pane, asking k or j between t try std.testing.expectEqualStrings("/mid", try outlined(&s, lit, names)); try s.keys("c"); try std.testing.expect(std.mem.indexOf(u8, try s.read(s.at("/pane/{d}/ctl", .{mid})), " collapsed ") == null); - try expectEqual(row_low, (try s.where("/low Save"))[1]); + try expectEqual(row_low, (try s.where("/low "))[1]); // d between two panes asks, as SPC d does; Esc takes it back, the // outline where it was. try s.keys("d"); @@ -210,7 +212,7 @@ test "modes: in window mode d deletes the outlined pane, asking k or j between t try s.keys("dj"); try std.testing.expect(!try listed(&s, mid)); try expectEqual(row_top, (try s.where("/test.txt Save"))[1]); - try expectEqual(row_mid, (try s.where("/low Save"))[1]); + try expectEqual(row_mid, (try s.where("/low "))[1]); try std.testing.expectEqualStrings("/low", try outlined(&s, lit, &.{ "/test.txt", "/low" })); // With one neighbour nothing is asked: d closes it, the outline on the // pane that grew. |
