From 70de5ec5ff3dad01afcc45244ad5e5a481486da6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 29 Oct 2026 17:01:35 -0300 Subject: dump: one walker dump of the whole session, by name across builds, for Restore, -l, Handover and the store; dump.zig's hand-written schema gone A dump is walk.zig's walk of the core with a table of every type it reaches (fields, enum and union names, number widths), read back by name; terminals are ghostty's snapshot (screens, history, kitty images); a failed load frees what it made. Co-Authored-By: Claude Opus 5.5 --- src/Query.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Query.zig') diff --git a/src/Query.zig b/src/Query.zig index 7440dd0e..8296aa80 100644 --- a/src/Query.zig +++ b/src/Query.zig @@ -2284,7 +2284,7 @@ test "a / query: keystroke by keystroke, the owner shows the set, rows from its try std.testing.expectEqual(@as(i32, 2), pane.body.cur_row); } -test "a dump holding a query pane, live or frozen, restores, the pane as plain text" { +test "a dump holding a query pane, live or frozen, restores it as it was" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 }); defer p.deinit(); _ = try p.setTestFile("alpha one\nbeta\nalphabet\n"); @@ -2295,9 +2295,10 @@ test "a dump holding a query pane, live or frozen, restores, the pane as plain t const restored = try pardes.dump.initFromDump(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 }, p.dump_out.?); defer restored.deinit(); const back = restored.panes[qid].?; - try std.testing.expect(back.query == null); - try std.testing.expectEqual(@as(usize, 0), back.file.?.location_rows.len); - try std.testing.expect(std.mem.startsWith(u8, back.file.?.content, "/alpha\n")); + const was = p.panes[qid].?; + try std.testing.expectEqual(was.query.?.frozen, back.query.?.frozen); + try std.testing.expectEqual(was.file.?.location_rows.len, back.file.?.location_rows.len); + try std.testing.expectEqualStrings(was.file.?.content, back.file.?.content); p.update(.{ .key = .{ .cp = Key.enter } }); } } -- cgit v1.3