summaryrefslogtreecommitdiff
path: root/test/pdf.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 00:42:04 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit425d9beb9c977df364ed83743cb2efdef9429478 (patch)
treeeaba2e20ff041b50539d1b47fdeb498e59237cf0 /test/pdf.zig
parent1912878e753ce12fdc1ac72ae2e83ddfc18df002 (diff)
downloadpardes-425d9beb9c977df364ed83743cb2efdef9429478.tar.gz
pardes-425d9beb9c977df364ed83743cb2efdef9429478.zip
File the tag code into tagline.zig and draw tags beside bodies
With tags reduced to Texts, what is left of them is the computed prefix, the default and saved tails, entering and leaving a tag and the headers: that goes to tagline.zig, as acme keeps the tag half of a window in wind.c. Tag and header drawing moves next to body drawing in body_layer.zig, and the tag hit helpers go to tag_layer.zig with the Hit they read, where sameCell now also tells the lines of a taller tag apart. The docs describe the tag as a Text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/pdf.zig')
-rw-r--r--test/pdf.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/pdf.zig b/test/pdf.zig
index 745ecb1a..3a592451 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -612,7 +612,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" {
try std.testing.expectEqual(@as(u16, 0), pane.pdf.?.pan_y);
try std.testing.expectEqual(@as(u16, 8), p.cell_pixels.w);
try std.testing.expectEqual(@as(u16, 16), p.cell_pixels.h);
- const initial_tag = try pardes.test_api.tagText(p, p.scratch.allocator(), pane);
+ const initial_tag = try pardes.tagline.tagText(p, p.scratch.allocator(), pane);
const expected_tag = try std.fmt.allocPrint(p.scratch.allocator(), "{s} [1/{d}]{s}", .{ pane.pdf.?.path, pane.pdf.?.page_count, pane_tail });
try std.testing.expectEqualStrings(expected_tag, initial_tag);
try std.testing.expect(std.mem.endsWith(u8, initial_tag, pane_tail));
@@ -833,7 +833,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" {
revision_before_toggle,
panes.Pdf.rasterForPage(&pane.pdf.?, pane.pdf.?.page).?.revision,
);
- const height_tag = try pardes.test_api.tagText(p, p.scratch.allocator(), pane);
+ const height_tag = try pardes.tagline.tagText(p, p.scratch.allocator(), pane);
const expected_height_tag = try std.fmt.allocPrint(p.scratch.allocator(), "{s} [{d}/{d}]{s}", .{ pane.pdf.?.path, pane.pdf.?.page + 1, pane.pdf.?.page_count, pane_tail });
try std.testing.expectEqualStrings(expected_height_tag, height_tag);
for (p.panes) |slot| {
@@ -1250,7 +1250,7 @@ test "PdfTint cycles pane-local state without adding tag clutter" {
return error.MissingPdfTintBuiltin;
try std.testing.expectEqual(PdfTintMode.filtered, pv.tint);
- const initial_tag = try pardes.test_api.tagText(p, p.scratch.allocator(), pane);
+ const initial_tag = try pardes.tagline.tagText(p, p.scratch.allocator(), pane);
try std.testing.expect(std.mem.startsWith(u8, initial_tag, pv.path));
try std.testing.expect(std.mem.endsWith(u8, initial_tag, " PdfSections PdfTint Collapse Del"));
try std.testing.expect(std.mem.indexOf(u8, initial_tag, "filtered") == null);
@@ -1263,7 +1263,7 @@ test "PdfTint cycles pane-local state without adding tag clutter" {
null,
));
try std.testing.expectEqual(PdfTintMode.full, pv.tint);
- const full_tag = try pardes.test_api.tagText(p, p.scratch.allocator(), pane);
+ const full_tag = try pardes.tagline.tagText(p, p.scratch.allocator(), pane);
try std.testing.expectEqualStrings(initial_tag, full_tag);
try std.testing.expect(std.mem.indexOf(u8, full_tag, "full") == null);
@@ -1291,7 +1291,7 @@ test "PdfTint cycles pane-local state without adding tag clutter" {
null,
));
try std.testing.expectEqual(PdfTintMode.disabled, pv.tint);
- const disabled_tag = try pardes.test_api.tagText(p, p.scratch.allocator(), pane);
+ const disabled_tag = try pardes.tagline.tagText(p, p.scratch.allocator(), pane);
try std.testing.expectEqualStrings(initial_tag, disabled_tag);
try std.testing.expect(std.mem.indexOf(u8, disabled_tag, "disabled") == null);
try std.testing.expect(pardes.test_api.runBuiltin(