summaryrefslogtreecommitdiff
path: root/test/pdf.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 06:32:21 -0300
committerGabriel Schneider <[email protected]>2026-10-01 07:16:43 -0300
commitbb9a5f19cf0ea6944fd8c67503e09aa5a2da4355 (patch)
tree6830ebe8257c5364aea388824a4cd4de26369311 /test/pdf.zig
parentc9e5c77eb9a20d7012ee972727f250f3a2fb95cc (diff)
downloadpardes-bb9a5f19cf0ea6944fd8c67503e09aa5a2da4355.tar.gz
pardes-bb9a5f19cf0ea6944fd8c67503e09aa5a2da4355.zip
`:N:H` looked at on a PDF pane turns to page N, as `book.pdf:N:H` does from anywhere, not a refusal that a PDF has no text
A PDF's own pane took only `:N`; `:5:3` was refused as no text to address while `book.pdf:5:3` turned to page 5 (its search hit 3). lookPdfPage now reads the page before a colon and the hit after it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/pdf.zig')
-rw-r--r--test/pdf.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/pdf.zig b/test/pdf.zig
index 727a1515..a1be4075 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -492,6 +492,12 @@ test "`:N` on a PDF turns to page N, from the pane and from the root's look, and
try std.testing.expect(std.mem.indexOf(u8, record, "\nerr ") == null);
_ = p.serveFs(.{ .tag = 4, .op = .release, .node = log, .handle = h });
while (p.nextEffect()) |_| {}
+ // `:N:H` on the pane is its page N, as `file.pdf:N:H` is.
+ p.look_missed = false;
+ pardes.look.lookAt(p, 0, ":1");
+ pardes.look.lookAt(p, 0, ":2:3");
+ try std.testing.expect(!p.look_missed);
+ try std.testing.expectEqual(@as(usize, 1), doc.pdf.?.page);
// Page 0 is no page: the has-no-page miss.
p.look_missed = false;
pardes.look.lookAt(p, 0, ":0");