Pixel-diff snapshot testing for rendered PDFs (issue #21): render →
rasterize (pdftoppm, part of poppler-utils — already a required
tool for this workspace's own text-extraction tests, so this adds no
new system dependency) → compare each page against a checked-in
reference PNG, with a small per-pixel tolerance for renderer noise.
Deliberately independent of lightweight-pdf-test-support (that
crate is this workspace's own internal dev-dependency, never
published) — this crate stands on its own, usable to pin any PDF
(not just ones built with lightweight-pdf) against visual
regressions.
Reference images are low-DPI grayscale PNG (DEFAULT_DPI) on purpose
— this is a regression trip-wire, not a print-quality visual proof,
and keeping them small keeps the repository's history small.
# fn render() -> Vec<u8> { vec![] }
let dir = std::path::Path::new("test-fixtures/snapshots");
lightweight_pdf_testing::assert_snapshot(dir, "invoice", &render());
Set UPDATE_SNAPSHOTS=1 to (re)write the reference images instead of
comparing against them.