summaryrefslogtreecommitdiff
path: root/test/mode.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 06:24:42 -0300
committerGabriel Schneider <[email protected]>2026-11-06 11:19:44 -0300
commitc1917b949b9580de8bf0977874a210f0266812da (patch)
tree447dd2235ea00634f662cd3becf4bceb8a895f41 /test/mode.zig
parent76c55b5bce0f181b0b15b16596c900397dfef544 (diff)
downloadpardes-c1917b949b9580de8bf0977874a210f0266812da.tar.gz
pardes-c1917b949b9580de8bf0977874a210f0266812da.zip
kinds #14, the core's PDF code gone: pdf.zig and pdf_view.zig leave and every pdf_enabled branch with them; look, Jump, Recent, dumps (one from before the addon opens as its pane), the watch, mouse, keys, the rail and the tag go through Kind for any kind's pane; test/pdf.zig's behaviours are T1 cases over 9P (addons_pdf.zig) and pane cases (a Shadow over a replica, a file changed under it), the harnesses load pdf.so by path
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/mode.zig')
-rw-r--r--test/mode.zig17
1 files changed, 1 insertions, 16 deletions
diff --git a/test/mode.zig b/test/mode.zig
index 7335b4ef..1f21c7db 100644
--- a/test/mode.zig
+++ b/test/mode.zig
@@ -89,25 +89,10 @@ test "Mode from actual tag Exec preserves parked file and output insert transact
}
}
-test "Mode leaves image and PDF document modes unchanged" {
+test "Mode leaves a kind's pane (a picture) as it is" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
const picture = try pardes.Kind.open(p, 1, pardes.Kind.test_kind.of(p), "/mode-test.png", "");
try mode(p, 1, .normal);
try std.testing.expect(picture.addon != null);
- if (comptime panes.Pdf.enabled) {
- var tmp = std.testing.tmpDir(.{});
- defer tmp.cleanup();
- const bytes = try panes.Pdf.pdf.testFixture(std.testing.allocator, "links.pdf");
- defer std.testing.allocator.free(bytes);
- try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "mode.pdf", .data = bytes });
- var buffer: [4096]u8 = undefined;
- const len = try tmp.dir.realPath(std.testing.io, &buffer);
- const path = try std.fmt.allocPrint(std.testing.allocator, "{s}/mode.pdf", .{buffer[0..len]});
- defer std.testing.allocator.free(path);
- const document = try panes.Pdf.openPane(p, 2, path, 1, .last);
- const page = document.pdf.?.page;
- try mode(p, 2, .normal);
- try std.testing.expectEqual(page, document.pdf.?.page);
- }
}