From f3070c04d3eaa0e0d3965478781c2d0b456446bf Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:22:47 -0300 Subject: A PDF place `:P:H` whose search hit H is not on page P, or with no search, is a miss with an err, as a page past the last is The second number of a PDF place is a hit of the pane's search (its search rows are `file.pdf:P:H`), and one that named no hit turned to page P silently. pdf State.hitExists asks the pane's search for page P: a hit it does not have, or any hit with no search, is now ` has no search hit H on page P`, on the pane itself (`:P:H`) and from anywhere (`file.pdf:P:H`); a search row's hit is always there. Co-Authored-By: Claude Opus 5.5 --- test/pdf.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/pdf.zig b/test/pdf.zig index a1be4075..00d678d4 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -492,12 +492,16 @@ 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. + // `:N:H` on the pane is hit H of its search on page N, as `file.pdf:N:H` + // (a search row) is: with no search there is no hit 3, a miss that + // turns no page. 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); + try std.testing.expect(p.look_missed); + try std.testing.expect(std.mem.indexOf(u8, doc.msg[0..doc.msg_len], "has no search hit 3 on page 2") != null); + try std.testing.expectEqual(@as(usize, 0), doc.pdf.?.page); + pardes.look.lookAt(p, 0, ":2"); // Page 0 is no page: the has-no-page miss. p.look_missed = false; pardes.look.lookAt(p, 0, ":0"); -- cgit v1.3