diff options
Diffstat (limited to 'test/behaviour/placement.zig')
| -rw-r--r-- | test/behaviour/placement.zig | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig index 73d69883..467afd1b 100644 --- a/test/behaviour/placement.zig +++ b/test/behaviour/placement.zig @@ -10,6 +10,8 @@ test "placement: an empty active column takes the new pane whole, a look from an const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const first = try s.focused(); // Its tag has the keyboard: it is the active column, and stays so // when Esc gives the keyboard back. @@ -31,6 +33,8 @@ fn tagRow(s: *Session, name: []const u8) !usize { test "placement: New and 9P's new take the bottom half of the column's last pane" { var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); const first = try s.focused(); try s.write(s.at("/pane/{d}/exec", .{first}), "New\n"); const last = try s.focused(); @@ -69,7 +73,8 @@ test "placement: a look from a pane pane/new made after Delcol opens its file in fn spans(s: *Session, comptime n: usize, names: [n][]const u8) ![n][2]usize { var out: [n][2]usize = undefined; for (names, 0..) |name, i| out[i][0] = try tagRow(s, name); - const rows = std.mem.count(u8, try s.screen(), "\n") + 1; + // The last pane ends over the notice row. + const rows = std.mem.count(u8, try s.screen(), "\n"); for (0..n) |i| out[i][1] = (if (i + 1 < n) out[i + 1][0] else rows) - out[i][0]; return out; } @@ -82,6 +87,8 @@ test "placement: a look from a pane's text goes under its text when it has many const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "one\ntwo\nthree\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); s.detach(); // Wide enough that a tag with the test's temporary path stays one row, // wherever the checkout is. @@ -116,6 +123,8 @@ test "placement: a look from the middle of a column splits only the pane it came const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; var s = try Session.initFile(std.testing.allocator, "one\n"); defer s.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + try s.write("/ctl", "Jumps new-pane\n"); s.detach(); try s.write("/ctl", "size 100 60\n"); const top = try s.focused(); @@ -131,8 +140,8 @@ test "placement: a look from the middle of a column splits only the pane it came const names = [_][]const u8{ "/test.txt", "/mid", "/low", "/made" }; // The top and bottom panes dragged by their boxes to two and three // rows, under a placement's minimum; the middle one full of text, so - // the one halved. - const rows = std.mem.count(u8, try s.screen(), "\n") + 1; + // the one halved. (The panes end over the notice row.) + const rows = std.mem.count(u8, try s.screen(), "\n"); const r = try spans(&s, 3, names[0..3].*); try s.write("/mousein", s.at("m 0 {d} 1\nm 0 {d} 1\nm 0 {d} 0\n", .{ r[1][0], r[0][0] + 2, r[0][0] + 2 })); try s.write("/mousein", s.at("m 0 {d} 1\nm 0 {d} 1\nm 0 {d} 0\n", .{ r[2][0], rows - 3, rows - 3 })); |
