summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/panes.zig26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 25f0f6db..ca53af3d 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -4890,3 +4890,29 @@ const LookResetTests = struct {
test {
_ = LookResetTests;
}
+
+test "a terminal's pty follows its pane down to its last row" {
+ const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 });
+ defer p.deinit();
+ p.presentation.enabled = false;
+ p.sync();
+ while (p.nextEffect()) |_| {}
+ const term = for (p.panes, 0..) |slot, i| {
+ if (slot) |pane| if (pane.isTerminal()) break i;
+ } else return error.NoTerminal;
+ p.newScratchBelow(term);
+ p.sync();
+ while (p.nextEffect()) |_| {}
+ // The terminal squeezed to its tag alone, folded by nobody.
+ p.panes[term].?.vweight = 0.01;
+ for (p.col_panes[0][0..p.col_n[0]]) |k| if (k != term) {
+ p.panes[k].?.vweight = 1000;
+ };
+ p.sync();
+ try std.testing.expect(p.rects[term].h <= p.panes[term].?.tag_rows);
+ var rows: ?u16 = null;
+ while (p.nextEffect()) |effect| if (effect == .resize_pty and effect.resize_pty.pane == term) {
+ rows = effect.resize_pty.rows;
+ };
+ try std.testing.expectEqual(@as(?u16, 1), rows);
+}