summaryrefslogtreecommitdiff
path: root/test/fs_namespace.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 02:56:53 -0300
committerGabriel Schneider <[email protected]>2026-11-06 04:13:33 -0300
commitd1d5d3cfb18841604bba2057eeb3598f729b4475 (patch)
tree298c29ab8767852bf74eb86ad4d15acc4348f109 /test/fs_namespace.zig
parent33037ece5af9ae1c7048819bbbae3fc5e6fc4ade (diff)
downloadpardes-d1d5d3cfb18841604bba2057eeb3598f729b4475.tar.gz
pardes-d1d5d3cfb18841604bba2057eeb3598f729b4475.zip
client #1, the views indexed: a view's share of the session is Pardes.View (the ~42 fields views.fields named: size, cell metrics, columns, rects, focus, jumps, pointer, gestures, prefixes, frontend), one of Pardes.views[4] (null when closed), the live one views[live] through Pardes.view() (index field `view` renamed `live`); going into another view is the index plus the panes' shares, which stay swapped (park and unpark now move only Pane.pv); views.zig loses fields, Part over Pardes, Parked, kept, emptied and the session half of every copy, and a pane closing leaves every view's layout at once (views.gone, at the two places a slot is freed) instead of the serials each parked view kept; drawOne and within put the drawn view's own share back whole; the views are in the digest now (tape's per-field parts name views[k].field), so a fresh view's col_x/col_w default to zeros, not undefined; the dump keeps every open view in the core and the panes' shares of the others under `shares`; an image from before (live view as the core's own fields, the rest under `views`) loads them into views[] once; the ~2,400 references rewritten mechanically from the compiler's errors (p.active is p.view().active, `const v = p.view()` hoisted in 823 places), Kind.zig (4 lines) and addon_test.zig (3) among them, macos.zig by pattern (not compiled here); tape's watched host writes read the live view's frontend and active; perf.zig's accessor lines change its harness hash, the debug baselines re-keyed to it (their numbers the base's); no golden changes; gates: core-test 956/956 both, unit-test 1487/1488 tui and 1530/1531 gui, behaviour-test 248/248 both, pane-test 171/172, snap all 105 ok, process-test 0 of 37 failed tui, replicas ok
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/fs_namespace.zig')
-rw-r--r--test/fs_namespace.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig
index 939232fc..6ee50f77 100644
--- a/test/fs_namespace.zig
+++ b/test/fs_namespace.zig
@@ -89,8 +89,8 @@ test "transactional restore preserves host capabilities and advances pane identi
const pane = try p.setTestFile("before\n");
p.lsp_ask.seq = 41;
p.pipe.seq = 73;
- if (@hasField(pardes.CellPixels, "w")) p.cell_pixels = .{ .w = 9, .h = 18 };
- p.frontend.native_images = true;
+ if (@hasField(pardes.CellPixels, "w")) p.view().cell_pixels = .{ .w = 9, .h = 18 };
+ p.view().frontend.native_images = true;
p.fs.socket_path = "/tmp/session.sock";
p.fs.tcp_address = .{ .ip4 = .loopback(5640) };
try pardes.dump.dumpState(p);
@@ -98,13 +98,13 @@ test "transactional restore preserves host capabilities and advances pane identi
defer restored.deinit();
try std.testing.expectEqual(@as(u32, 41), restored.lsp_ask.seq);
try std.testing.expectEqual(@as(u32, 73), restored.pipe.seq);
- try std.testing.expectEqual(p.cell_pixels, restored.cell_pixels);
- try std.testing.expect(restored.frontend.native_images);
+ try std.testing.expectEqual(p.view().cell_pixels, restored.view().cell_pixels);
+ try std.testing.expect(restored.view().frontend.native_images);
// The dump's pane, its serial too; a new one is past the old session's.
try std.testing.expectEqual(pane.serial, restored.panes[0].?.serial);
try std.testing.expect(restored.next_serial >= p.next_serial);
- try std.testing.expectEqual(p.screen_w, restored.screen_w);
- try std.testing.expectEqual(p.screen_h, restored.screen_h);
+ try std.testing.expectEqual(p.view().screen_w, restored.view().screen_w);
+ try std.testing.expectEqual(p.view().screen_h, restored.view().screen_h);
try std.testing.expect(p.panes[0] == pane);
try std.testing.expectEqualStrings("before\n", pane.file.?.content);
try std.testing.expectError(error.BadDump, pardes.dump.restore(
@@ -263,7 +263,7 @@ test "owned cwd failed file opens never publish a pane or retain a reservation"
const name = try std.fmt.bufPrint(&path, "/virtual/pane/{d}/body", .{source.serial});
const slot = p.freeSlot().?;
const serial = p.next_serial;
- const columns = p.cols;
+ const columns = p.view().cols;
allocator.fail_index = allocator.alloc_index + failure;
const opened = pardes.panes.File.open(p, slot, name, 0) catch |err| {
try std.testing.expect(err == error.OutOfMemory or err == error.ReadFailed or err == error.WriteFailed);
@@ -271,7 +271,7 @@ test "owned cwd failed file opens never publish a pane or retain a reservation"
try std.testing.expect(!p.reserved_slots[slot]);
try std.testing.expectEqual(serial, p.next_serial);
try std.testing.expectEqual(slot, p.freeSlot().?);
- try std.testing.expectEqualDeep(columns, p.cols);
+ try std.testing.expectEqualDeep(columns, p.view().cols);
try std.testing.expectEqual(@as(usize, 0), p.effects_len);
try std.testing.expectEqualStrings("/source/directory", source.cwdSlice());
allocator.fail_index = std.math.maxInt(usize);