diff options
Diffstat (limited to 'test/behaviour/placement.zig')
| -rw-r--r-- | test/behaviour/placement.zig | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig new file mode 100644 index 00000000..350e94f8 --- /dev/null +++ b/test/behaviour/placement.zig @@ -0,0 +1,24 @@ +//! docs/typ/reference.typ, Placement <placement>. +const std = @import("std"); +const Session = @import("session").Session; + +test "placement: an empty active column takes the new pane whole, a look from another column's text too" { + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "f.txt", .data = "f\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, "x\n"); + defer s.deinit(); + const first = try s.focused(); + // Its tag has the keyboard: it is the active column, and stays so + // when Esc gives the keyboard back. + try s.write("/ctl", "Newcol\n"); + try s.keys("\x1b"); + try std.testing.expectEqual(first, try s.focused()); + // A look from the first pane's text still lands in the active column, + // as acme's makenewwindow puts it in activecol first (util.c:456). + try s.write(s.at("/pane/{d}/look", .{first}), s.at("{s}/f.txt\n", .{at})); + const made = try s.focused(); + try std.testing.expectEqualStrings(s.at("{d}:{d} {d}:{d}", .{ try s.column(0), first, try s.column(1), made }), try s.columns()); +} |
