diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour/keys.zig | 7 | ||||
| -rw-r--r-- | test/behaviour/modes.zig | 12 | ||||
| -rw-r--r-- | test/panes.zig | 3 |
3 files changed, 13 insertions, 9 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. diff --git a/test/panes.zig b/test/panes.zig index ba3466fb..fd974b6c 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -2073,7 +2073,8 @@ const OutputTests = struct { try std.testing.expect(help.body.vsel.active); try std.testing.expect(help.body.vsel.row > 5); try std.testing.expect(help.body.cur_row != help.body.vsel.row); - for (" h?") |key| p.update(.{ .key = .{ .cp = key } }); + // `Help h`, the word (SPC h ? is Help in the tag now: walk UI). + try std.testing.expect(p.executeBuiltinLine(id, "Help h")); try std.testing.expectEqual(id, p.view().active); const content = help.file.?.content; try std.testing.expect(std.mem.startsWith(u8, content, "pardes builtins under SPC h\n")); |
