diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-29 17:01:35 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-29 21:13:33 -0300 |
| commit | 70de5ec5ff3dad01afcc45244ad5e5a481486da6 (patch) | |
| tree | cd4b723dcc2cfd94c4ba2361c134927b0e2df60b /src/Query.zig | |
| parent | 349790339897466f323ff28748916aa48aa344f7 (diff) | |
| download | pardes-70de5ec5ff3dad01afcc45244ad5e5a481486da6.tar.gz pardes-70de5ec5ff3dad01afcc45244ad5e5a481486da6.zip | |
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 <[email protected]>
Diffstat (limited to 'src/Query.zig')
| -rw-r--r-- | src/Query.zig | 9 |
1 files changed, 5 insertions, 4 deletions
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 } }); } } |
