summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 407f2c3c..022d672c 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -1416,7 +1416,7 @@ test "Save rearms renamed file watches only after a successful write" {
const h: *@This() = @ptrCast(@alignCast(ctx.?));
switch (h.result) {
.success => {},
- .failure => h.core.saveFailed(id, "save", error.PermissionDenied),
+ .failure => h.core.saveFailed(.at(id), "save", error.PermissionDenied),
.edited => h.core.panes[id].?.file.?.revision +%= 1,
.replaced => {
const replacement = h.core.setTestFile("replacement\n") catch |err| {
@@ -1486,7 +1486,7 @@ test "Save on a scratch does not watch a path the host could not create" {
const Refusing = struct {
fn write(ctx: ?*anyopaque, id: u8, _: []const u8, _: []const u8) void {
const p: *Pardes = @ptrCast(@alignCast(ctx.?));
- p.saveFailed(id, "save", error.PermissionDenied);
+ p.saveFailed(.at(id), "save", error.PermissionDenied);
}
};
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 40, .rows = 12 });
@@ -1520,7 +1520,7 @@ test "a failed Save to another name leaves a clean named file clean" {
const Refusing = struct {
fn write(ctx: ?*anyopaque, id: u8, _: []const u8, _: []const u8) void {
const p: *Pardes = @ptrCast(@alignCast(ctx.?));
- p.saveFailed(id, "save", error.AccessDenied);
+ p.saveFailed(.at(id), "save", error.AccessDenied);
}
};
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 40, .rows = 12 });
@@ -2500,7 +2500,7 @@ const TerminalTests = struct {
else => {},
};
- p.acknowledgeShell(0, "/bin/bash", true);
+ p.acknowledgeShell(.at(0), "/bin/bash", true);
while (p.nextEffect()) |effect| switch (effect) {
.write => return error.CommandEscapedBeforePrompt,
else => {},
@@ -2533,7 +2533,7 @@ const TerminalTests = struct {
while (p.nextEffect()) |_| {}
try std.testing.expect(pane.greet);
- p.acknowledgeShell(0, "/bin/sh", false);
+ p.acknowledgeShell(.at(0), "/bin/sh", false);
try std.testing.expect(!pane.greet);
try std.testing.expectEqual(.none, pane.pending_command.wait);
p.update(.{ .output = .{ .pane = 0, .bytes = "plain prompt$ " } });
@@ -4077,7 +4077,7 @@ const PdfAddon = struct {
// Another file under its name (an outline's three pages): opened
// again, on the page it can still be on, as height-fitted.
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "live.pdf", .data = try std.Io.Dir.cwd().readFileAlloc(std.testing.io, "test/pdf-fixtures/outline.pdf", p.scratch.allocator(), .unlimited) });
- try std.testing.expect(p.reloadWatchedFile(@intCast(id), &.{}));
+ try std.testing.expect(p.reloadWatchedFile(.at(id), &.{}));
p.update(.tick);
var arena: std.heap.ArenaAllocator = .init(gpa);
defer arena.deinit();
@@ -4225,7 +4225,7 @@ const PdfAddon = struct {
defer arena.deinit();
var at: [2][8][4]u32 = @splat(@splat(@splat(0)));
for ([_]*Pardes{ a.core, win.core() }, [_]u8{ 0, k.view }, &at) |core, view, *rows| {
- core.toView(view);
+ core.toView(.at(view));
var n: usize = 0;
for ((try core.render(arena.allocator())).placements.items) |pl| if (pl.pane == id and pl.raster.w > 1 and n < rows.len) {
rows[n] = if (pl.at) |x| .{ x.y, x.h, pl.src.y, pl.src.h } else .{ 0, 0, pl.src.y, pl.src.h };
@@ -4285,7 +4285,7 @@ const PdfAddon = struct {
try std.testing.expect(first.len > 0);
var arena: std.heap.ArenaAllocator = .init(gpa);
defer arena.deinit();
- win.core().toView(c.view);
+ win.core().toView(.at(c.view));
const s = try win.core().render(arena.allocator());
const r = win.core().view().rects[c.id];
var row: [512]u8 = undefined;