Hacker News new | ask | show | jobs
by patrickg 1206 days ago
This is what I do

I have ca. 190 test cases on which I run my software and compare the md5 sums of the resulting PDF. If they are not the same, I create a PNG for every page and compare visually with imagemagick.

The trick is to remove all random stuff from the PDF (like ID generation or such).

This takes about 3 seconds on the M1 Pro laptop. I think this is very much okay.

Links: https://github.com/speedata/publisher/tree/develop/qa (the tests) https://github.com/speedata/publisher/blob/develop/src/go/sp... (the Go source code for the comparison)