summaryrefslogtreecommitdiff
path: root/test/process/root_ctl.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/process/root_ctl.zig')
-rw-r--r--test/process/root_ctl.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/process/root_ctl.zig b/test/process/root_ctl.zig
index 008cc882..8ad92f7d 100644
--- a/test/process/root_ctl.zig
+++ b/test/process/root_ctl.zig
@@ -27,6 +27,8 @@ fn exitAnswers(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
/// Nothing attached, no key, no click, no other request comes to move it along.
fn messagesExpire(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
+ // With nothing attached: a window always is.
+ try process.only(.tty);
var d = try process.Detached.start(gpa, exe, "msg", .{});
defer d.deinit();
try d.files.write("/pane/1/ctl", "Msg lingering-words\n");
@@ -176,7 +178,8 @@ fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
var screen: process.Files = .init(gpa, address);
defer screen.deinit();
const width = try std.unicode.utf8CountCodepoints(std.mem.sliceTo(try screen.screen(), '\n'));
- try std.testing.expectEqual(@as(usize, if (tty) 80 else 160), width); // a detached one is 160x50
+ // A detached one is 160x50; a window keeps its own size.
+ if (process.backend == .tty) try std.testing.expectEqual(@as(usize, if (tty) 80 else 160), width);
const opened = try restored.look(a, try std.fmt.allocPrint(a, "/n/own/os{s}", .{d.abs(try std.fmt.allocPrint(a, "{s}.txt", .{name}))}), ids[1]);
try std.testing.expectEqualStrings("initial\n", try restored.pane(a, opened, "body"));
}