No matter your packages and templates are on or off Typst Universe , it is important to know whether or not there are something different with multiple versions of Typst. For …
the Primary
, why not compare images?
typst-0150 c my.typ a.png
typst-0142 c my.typ b.png
# Linux Debian/Ubuntu or Microsoft WSL
diffimg a.png b.png diff.png
firefox *.png
the Junior
, learn and use Tytanic package
gh repo read-file docs/book/src/README.md --repo tingerrr/tytanic
the Senior
, just do testing as Typst do,
gh repo read-file tests/README.md --repo typst/typst
Testing strategies
There are currently two approaches to testing output in the test suite.
File references
File references store the expected output directly inside the ref directory
and are committed to this repository. Newly produced output is compared to the
expected reference in order to determine if a test fails or passes.
Hashed references
Hashed references only store a hash of the expected output inside a
ref/{format}/hashes.txt file, which is committed to this repository. This is
mainly done to prevent repository bloat; each hash takes up only 32 bytes of
storage space, no matter how large the output file. When a test is run, its
output is hashed using the same stable hash function and compared to the
reference hash.