summaryrefslogtreecommitdiff
path: root/core/ninep/events.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 20:31:32 -0300
committerGabriel Schneider <[email protected]>2026-11-19 20:31:32 -0300
commit0db34fbf28e70c8c6a3c6025c0888fc5ec75201c (patch)
treef2e288668decded9276ebc45907f16d651b06f9e /core/ninep/events.zig
parent2ab05b536bc3b063666b5aaab497157adc2a9120 (diff)
parentbf351b62e8843a3d173cedeefa2dd0b8ef4b4392 (diff)
downloadpardes-0db34fbf28e70c8c6a3c6025c0888fc5ec75201c.tar.gz
pardes-0db34fbf28e70c8c6a3c6025c0888fc5ec75201c.zip
integration: a pane's and a view's slot as types, with the regular-expression fixes and the fixes the real loops asked for: pardes-ids (Pane.Id and View.Id through the entries, the events, the effects, the Host table and the device messages) and pardes-merge21, merged without a textual conflict; one call site written since on the old type follows (core/draw.zig: the twin test's file_changed event, .pane = .at(0)); tui core-test 848/991 (143 skipped), shell-test 1027/1030, the window builds; gates in the coordinator's ledger
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/ninep/events.zig')
-rw-r--r--core/ninep/events.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/core/ninep/events.zig b/core/ninep/events.zig
index 1e740345..93a1187a 100644
--- a/core/ninep/events.zig
+++ b/core/ninep/events.zig
@@ -1180,7 +1180,7 @@ test "the log records whether or not anyone reads, and an open that follows wait
);
// What the editor says is in the same stream, one line even when the
// message had several.
- p.setMessage(id, "save: two\nlines");
+ p.setMessage(.at(id), "save: two\nlines");
try testing.expectEqualStrings(
try std.fmt.bufPrint(&expected, "msg {d} save: two lines\n", .{serial}),
rdf.next(p, log, fh, frozen).bytes,
@@ -1198,7 +1198,7 @@ test "the log records whether or not anyone reads, and an open that follows wait
// pieces rather than failing. A repeat the follower waits on, having
// read the first, is its own line.
const said_by = p.panes[0].?.serial;
- p.setMessage(0, "same failure");
+ p.setMessage(.at(0), "same failure");
var pieced: [64]u8 = undefined;
var got: usize = 0;
while (got == 0 or pieced[got - 1] != '\n') {
@@ -1207,14 +1207,14 @@ test "the log records whether or not anyone reads, and an open that follows wait
got += piece.len;
}
try testing.expectEqualStrings(try std.fmt.bufPrint(&expected, "msg {d} same failure\n", .{said_by}), pieced[0..got]);
- p.setMessage(0, "same failure");
+ p.setMessage(.at(0), "same failure");
try testing.expectEqualStrings(try std.fmt.bufPrint(&expected, "msg {d} same failure (x2)\n", .{said_by}), rdf.next(p, log, fh, frozen).bytes);
// A follower the ring outran hears how much it missed, then carries on.
var filler: [200]u8 = @splat('x');
for (0..p.fs.log.cap / filler.len + 8) |i| {
_ = std.fmt.bufPrint(&filler, "{d:0>6}", .{i}) catch unreachable; // a repeat would collapse
- p.setMessage(0, &filler);
+ p.setMessage(.at(0), &filler);
}
const lost = rdf.next(p, log, fh, frozen).bytes;
try testing.expect(std.mem.startsWith(u8, lost, "lost "));
@@ -1226,7 +1226,7 @@ test "the log records whether or not anyone reads, and an open that follows wait
// everything else pushed out ahead of it.
p.fs.log.cap = 128;
var huge: [300]u8 = @splat('y');
- p.setMessage(0, &huge);
+ p.setMessage(.at(0), &huge);
const cut = call(p, .{ .tag = 11, .op = .open, .node = log });
const kept = call(p, .{ .tag = 12, .op = .read, .node = log, .handle = cut.reply.handle, .size = 512 }).bytes;
try testing.expectEqual(@as(usize, 124), kept.len);
@@ -1328,7 +1328,7 @@ test "a pane named before it is announced has its new under that name, and no re
const shell = try p.newShell(free, "");
try testing.expectEqualStrings(p.sessionDir(), pane_files.nameOf(p, shell));
announce(p);
- p.setCwd(free, p.sessionDir());
+ p.setCwd(.at(free), p.sessionDir());
const after = try freezeLog(p);
defer p.gpa.free(after.bytes);
try testing.expect(std.mem.indexOf(u8, after.bytes, try std.fmt.bufPrint(&want, "rename {d} ", .{shell.serial})) == null);
@@ -1427,12 +1427,12 @@ test "follow new skips what the log held and waits for what comes after" {
defer p.deinit();
p.update(.tick); // the pane's `new` is logged first
while (p.nextEffect()) |_| {}
- p.setMessage(0, "before the open");
+ p.setMessage(.at(0), "before the open");
const log = @backingInt(tree.TopFile.log);
const h = call(p, .{ .tag = 1, .op = .open, .node = log }).reply.handle;
try testing.expectEqual(Status.ok, call(p, .{ .tag = 2, .op = .write, .node = log, .handle = h, .data = "follow new\n" }).reply.status);
try testing.expectEqual(Status.again, call(p, .{ .tag = 3, .op = .read, .node = log, .handle = h, .size = 4096 }).reply.status);
- p.setMessage(0, "after it");
+ p.setMessage(.at(0), "after it");
try testing.expect(std.mem.endsWith(u8, call(p, .{ .tag = 4, .op = .read, .node = log, .handle = h, .size = 4096 }).bytes, " after it\n"));
_ = call(p, .{ .tag = 5, .op = .release, .node = log, .handle = h });
}
@@ -1482,10 +1482,10 @@ test "two failures that agree only in what their records cut are two records, no
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
const long = std.mem.asBytes(&@as([80][4]u8, @splat("why ".*)));
- p.setMessage(0, long ++ "first");
- p.setMessage(0, long ++ "second");
+ p.setMessage(.at(0), long ++ "first");
+ p.setMessage(.at(0), long ++ "second");
try testing.expect(!th.logHas(p, "(x2)"));
- p.setMessage(0, long ++ "second");
+ p.setMessage(.at(0), long ++ "second");
try testing.expect(th.logHas(p, "(x2)"));
}