summaryrefslogtreecommitdiff
path: root/test/hxdiff.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/hxdiff.zig')
-rw-r--r--test/hxdiff.zig12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/hxdiff.zig b/test/hxdiff.zig
index 85c854a0..7c72475f 100644
--- a/test/hxdiff.zig
+++ b/test/hxdiff.zig
@@ -376,12 +376,19 @@ test "differential reports compare values and report every changed field" {
try std.testing.checkAllAllocationFailures(allocator, Check.run, .{ want, changed });
}
+/// The text rows of hx-harness's one view (80x24 less its two lines).
+const helix_view_rows = 22;
+
fn runCase(arena: std.mem.Allocator, case: Case, pane_kind: []const u8) !Result {
// fresh core per case: the tty_only boot — one shell pane, tty mode, no
// greeting. Live-session contract: sizes arrive as the first resize event.
const core = try pardes.Pardes.init(gpa, .{ .tty_only = true });
defer core.deinit();
- core.update(.{ .resize = .{ .cols = 80, .rows = 24 } });
+ // helix's harness runs at 80x24, a view of 22 text rows under its
+ // status and command lines; pardes's chrome takes a row more, so 25
+ // rows give its pane the same 22 that every page, half page and gb
+ // counts in
+ core.update(.{ .resize = .{ .cols = 80, .rows = 25 } });
pump(core);
if (std.mem.eql(u8, pane_kind, "file")) {
@@ -418,6 +425,9 @@ fn runCase(arena: std.mem.Allocator, case: Case, pane_kind: []const u8) !Result
}
} else fatal("case {s}: unknown pane {s}", .{ case.name, pane_kind });
+ const shown = core.panes[core.view().active] orelse return error.NoActivePane;
+ if (shown.rows != helix_view_rows) fatal("case {s}: the pane shows {d} rows, not helix's {d}: resize the core to match", .{ case.name, shown.rows, helix_view_rows });
+
// keys: helix notation — printables verbatim, <...> specials
var ki: usize = 0;
while (ki < case.keys.len) {