summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/behaviour/placement.zig23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig
index 73d69883..f6823feb 100644
--- a/test/behaviour/placement.zig
+++ b/test/behaviour/placement.zig
@@ -108,6 +108,29 @@ test "placement: a look from a pane's text goes under its text when it has many
try std.testing.expectEqual(was[big][0] + was[big][1], now[big + 1][0] + now[big + 1][1]);
}
+test "placement: under Tagbottom a look from a pane's text goes under its text too, every line of it still in sight above its tag" {
+ var tmp = std.testing.tmpDir(.{});
+ defer tmp.cleanup();
+ try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "second.txt", .data = "second\n" });
+ var dir: [4096]u8 = undefined;
+ const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)];
+ var s = try Session.initFile(std.testing.allocator, "alpha\nbeta\ngamma\n");
+ defer s.deinit();
+ s.detach();
+ try s.write("/ctl", "size 200 60\n");
+ try s.write("/ctl", "Tagbottom on\n");
+ const top = try s.focused();
+ try s.write(s.at("/pane/{d}/look", .{top}), s.at("{s}/second.txt\n", .{at}));
+ // The first pane keeps its three lines with its tag under them, at its
+ // foot: the split leaves it its tag and its text whichever end the tag
+ // is on (makenewwindow, util.c:482-486). The new pane starts below.
+ const alpha = (try s.where("alpha"))[1];
+ try std.testing.expectEqual(alpha + 1, (try s.where("beta"))[1]);
+ try std.testing.expectEqual(alpha + 2, (try s.where("gamma"))[1]);
+ try std.testing.expectEqual(alpha + 3, try tagRow(&s, "/test.txt"));
+ try std.testing.expectEqual(alpha + 4, (try s.where("second"))[1]);
+}
+
test "placement: a look from the middle of a column splits only the pane it came from, short ones round it kept short, through a Newcol too" {
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();