typst/tests
Laurenz 73615f7e3c Text shaping 🚀
- Shapes text with rustybuzz
- Font fallback with family list
- Tofus are shown in the first font

Co-Authored-By: Martin <mhaug@live.de>
2021-03-24 17:12:34 +01:00
..
ref Text shaping 🚀 2021-03-24 17:12:34 +01:00
res Update coma example ⬆️ 2021-02-18 15:19:29 +01:00
typ Text shaping 🚀 2021-03-24 17:12:34 +01:00
README.md Scheduled maintenance 🔨 2021-03-19 17:57:31 +01:00
typeset.rs Text shaping 🚀 2021-03-24 17:12:34 +01:00

Tests

Directory structure

Top level directory structure:

  • typ: Input files.
  • res: Resource files used by tests.
  • ref: Reference images which the output is compared with to determine whether a test passed or failed.
  • png: PNG files produced by tests.
  • pdf: PDF files produced by tests.

Running the tests

Running the integration tests (the tests in this directory).

cargo test --test typeset

Running all tests whose names contain the word filter.

cargo test --test typeset filter

To make the integration tests go faster they don't generate PDFs by default. Pass the --pdf flag to generate those. Mind that PDFs are not tested automatically at the moment, so you should always check the output manually when making changes.

cargo test --test typeset -- --pdf

Creating new tests

To keep things small, please optimize reference images before committing them. When you use the approve buttom from the Test Helper (see the tools folder) this happens automatically if you have oxipng installed.

# One image
oxipng -o max path/to/image.png

# All images
oxipng -r -o max tests/ref