summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fs_namespace.zig2
-rw-r--r--test/panes.zig16
-rw-r--r--test/replicas.zig2
-rw-r--r--test/session.zig4
4 files changed, 12 insertions, 12 deletions
diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig
index fa6657eb..ef5dec60 100644
--- a/test/fs_namespace.zig
+++ b/test/fs_namespace.zig
@@ -256,7 +256,7 @@ test "owned cwd failed file opens never publish a pane or retain a reservation"
const p = try pardes.Pardes.init(allocator.allocator(), .{ .tty_only = true });
defer p.deinit();
const source = try p.setTestFile("source body\n");
- p.setCwd(0, "/source/directory");
+ p.setCwd(.at(0), "/source/directory");
while (p.nextEffect()) |_| {}
var path: [128]u8 = undefined;
const name = try std.fmt.bufPrint(&path, "/virtual/pane/{d}/body", .{source.serial});
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;
diff --git a/test/replicas.zig b/test/replicas.zig
index 7f7ca0b3..88881dd7 100644
--- a/test/replicas.zig
+++ b/test/replicas.zig
@@ -1393,7 +1393,7 @@ const Soak = struct {
s.clock();
var buf: [64]u8 = undefined;
const ev = nextEvent(s.random, &buf, s.aim, s.looks, &s.own_script);
- core.toView(0);
+ core.toView(.at(0));
core.update(ev);
s.own_left -= 1;
if (s.own_left > 0) try s.net.send(.{ .at = m.at + typistGap(s.random), .n = 0, .kind = .own, .who = 0, .bytes = &.{} }) else s.typing -= 1;
diff --git a/test/session.zig b/test/session.zig
index 844ea2fe..bf118533 100644
--- a/test/session.zig
+++ b/test/session.zig
@@ -368,9 +368,9 @@ pub const Session = struct {
const p = pardesOf(s);
const gpa = p.gpa;
const name = p.takeRestore() orelse return;
- const bytes = pardes.dump.restoreBytes(p, gpa, name) catch |err| return p.reportError(p.view().active, "Restore", err);
+ const bytes = pardes.dump.restoreBytes(p, gpa, name) catch |err| return p.reportError(.at(p.view().active), "Restore", err);
defer gpa.free(bytes);
- const nc = pardes.dump.restore(p, bytes, name) catch |err| return p.reportError(p.view().active, "Restore", err);
+ const nc = pardes.dump.restore(p, bytes, name) catch |err| return p.reportError(.at(p.view().active), "Restore", err);
p.deinit();
s.core = nc;
s.drain();