summaryrefslogtreecommitdiff
path: root/src/ninep/pty.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep/pty.zig')
-rw-r--r--src/ninep/pty.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ninep/pty.zig b/src/ninep/pty.zig
index c58cf676..d80f7175 100644
--- a/src/ninep/pty.zig
+++ b/src/ninep/pty.zig
@@ -893,7 +893,7 @@ test "a shell that exits under a run answers its status, and the log says exit b
const prompt = "\x1b]133;A;cl=line;aid=pardes\x07$ \x1b]133;B;aid=pardes\x07";
p.update(.{ .output = .{ .pane = 0, .bytes = prompt } });
while (p.nextEffect()) |_| {}
- const log = @intFromEnum(tree.TopFile.log);
+ const log = @backingInt(tree.TopFile.log);
const f = call(p, .{ .tag = 1, .op = .open, .node = log }).reply.handle;
const frozen = call(p, .{ .tag = 2, .op = .read, .node = log, .handle = f, .size = 1 << 16 }).bytes.len;
_ = call(p, .{ .tag = 3, .op = .write, .node = log, .handle = f, .data = "follow" });
@@ -984,7 +984,6 @@ test "a run's answer says cut when its output's start is gone, and reads a bound
var got = sh.answered(p, node, h, into);
try testing.expectEqualStrings("exit 0\nafter\n", got);
-
// A resize between its start and end reflows the pins with the text.
h = sh.send(p, node);
sh.put(p, c ++ "one\r\ntwo\r\n");
@@ -1044,12 +1043,12 @@ test "a run's answer says cut when its output's start is gone, and reads a bound
const q = try withTerm(gpa);
defer q.deinit();
const kept = q.panes[0].?;
- kept.terminal.?.vt.screens.get(.primary).?.pages.explicit_max_size = 1;
+ kept.terminal.?.vt.screens.get(.primary).?.pages.limits.set(.bytes, 1);
const run = Node.of(serialOf(q), .pty_run);
sh.put(q, prompt);
h = sh.send(q, run);
sh.put(q, c);
- const lines = "pruned\r\n" ** 64;
+ const lines = std.mem.asBytes(&@as([64][8]u8, @splat("pruned\r\n".*)));
var fed: usize = 0;
while (!kept.terminal.?.stream.handler.out_start.?.garbage) : (fed += 1) {
if (fed == 1000) return error.TestUnexpectedResult;
@@ -1092,7 +1091,7 @@ test "a terminal's ctl counts its body, and a new directory is a rename in the l
_ = fields.next();
try testing.expectEqual(body_len, try std.fmt.parseInt(usize, fields.next().?, 10));
- const log = @intFromEnum(tree.TopFile.log);
+ const log = @backingInt(tree.TopFile.log);
const f = call(p, .{ .tag = 4, .op = .open, .node = log }).reply.handle;
const frozen = call(p, .{ .tag = 5, .op = .read, .node = log, .handle = f, .size = 1 << 16 }).bytes.len;
_ = call(p, .{ .tag = 6, .op = .write, .node = log, .handle = f, .data = "follow" });
@@ -1146,7 +1145,7 @@ test "a run's answer longer than its room is cut, its newline kept" {
var slot: Run = .{};
const p = try th.withTerm(testing.allocator);
defer p.deinit();
- answer(p, &slot, "busy: {s} is running", .{"x" ** 200});
+ answer(p, &slot, "busy: {s} is running", .{&@as([200]u8, @splat('x'))});
try testing.expectEqual(slot.answer.len, slot.len);
try testing.expectEqual(@as(u8, '\n'), slot.answer[slot.len - 1]);
}