summaryrefslogtreecommitdiff
path: root/test/pdf.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 17:01:35 -0300
committerGabriel Schneider <[email protected]>2026-10-29 21:13:33 -0300
commit70de5ec5ff3dad01afcc45244ad5e5a481486da6 (patch)
treecd4b723dcc2cfd94c4ba2361c134927b0e2df60b /test/pdf.zig
parent349790339897466f323ff28748916aa48aa344f7 (diff)
downloadpardes-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 'test/pdf.zig')
-rw-r--r--test/pdf.zig39
1 files changed, 0 insertions, 39 deletions
diff --git a/test/pdf.zig b/test/pdf.zig
index a50f3bf6..3bb751e2 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -278,45 +278,6 @@ test "PDF feature gates keep argv and builtin behavior coherent" {
}
}
-test "PDF dump fallback remains a byte-preserving file" {
- const gpa = std.testing.allocator;
- const path = "/definitely/missing/pardes-dump-fallback.PDF";
- const source = "%PDF embedded fallback bytes\x00\xff";
- const encoded = try dump.encodeBytes(gpa, source);
- defer gpa.free(encoded);
- const ids = [_]usize{0};
- const columns = [_]dump.Column{.{ .panes = &ids }};
- const saved_panes = [_]dump.Pane{.{
- .kind = .image,
- .tag = "pdf 3/9 height PdfFit full PdfTint PdfSections " ++ path ++ " Keep Del",
- .tag_tail = " Keep Del",
- .body = "",
- .scroll = 2,
- .cols = 80,
- .rows = 24,
- .image = .{ .path = path, .bytes_b64 = encoded },
- }};
- const state = dump.State{
- .screen = .{ .cols = 80, .rows = 24 },
- .columns = &columns,
- .panes = &saved_panes,
- };
- var out: std.Io.Writer.Allocating = .init(gpa);
- defer out.deinit();
- try std.zon.stringify.serialize(state, .{ .whitespace = true }, &out.writer);
-
- const restored = try pardes.dump.initFromDump(gpa, .{ .tty_only = true }, out.written());
- defer restored.deinit();
- const pane = restored.panes[0].?;
- try std.testing.expect(pane.file != null);
- try std.testing.expect(pane.image == null);
- try std.testing.expect(!hasPdf(pane));
- try std.testing.expectEqualStrings(path, pane.file.?.path);
- try std.testing.expectEqualSlices(u8, source, pane.file.?.content);
- try std.testing.expect(pane.tag.own != null);
- try std.testing.expectEqualStrings(" Keep Del", pane.tag.own.?);
-}
-
test "a +PdfSections row's first number is the page: a section not there, or on another page, is a miss said" {
if (!pdf_enabled or platform == .web) return;
const gpa = std.testing.allocator;