summaryrefslogtreecommitdiff
path: root/test/pdf.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 01:00:42 -0300
committerGabriel Schneider <[email protected]>2026-10-01 01:35:12 -0300
commit28e90e064bd317d0e253edb2f5b305a6192f560b (patch)
treea8270fb893fcbf617fc233290e5d5640bece35ec /test/pdf.zig
parenta909c1728315b6199cb9fca8eb3e9c4bb217ce7b (diff)
downloadpardes-28e90e064bd317d0e253edb2f5b305a6192f560b.tar.gz
pardes-28e90e064bd317d0e253edb2f5b305a6192f560b.zip
A bare :N or :N:M look addresses the pane itself, its line N (column M), from every way a look comes; a PDF's :0 has no page 0
A look of `:12` had no path to resolve, so it fell through to a word search for the text ":12" and found nothing. A digit-led address with no path now names the looking pane, as `:/re/` already did: its look, the root's (the keyboard's pane), Look, B3 and an event write-back all reach it, a terminal's logical lines included. On a PDF, :0 is the has-no-page miss rather than a refusal. 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 6864f247..d1dd5bb0 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -442,6 +442,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()) |_| {}
+ // Page 0 is no page: the has-no-page miss.
+ p.look_missed = false;
+ pardes.look.lookAt(p, 0, ":0");
+ try std.testing.expect(p.look_missed);
+ try std.testing.expect(std.mem.indexOf(u8, doc.msg[0..doc.msg_len], "has no page 0") != null);
+ p.look_missed = false;
// A byte offset or a pattern is no PDF address: refused with words.
pardes.look.lookAt(p, 0, ":#3");
try std.testing.expect(p.look_missed);