mirror of
https://github.com/typst/typst
synced 2025-05-28 07:55:28 +08:00
Supports: - Closure syntax: `(x, y) => z` - Shorthand for a single argument: `x => y` - Function syntax: `let f(x) = y` - Capturing of variables from the environment - Error messages for too few / many passed arguments Does not support: - Named arguments - Variadic arguments with `..`
Tests
Directory structure
Top level directory structure:
typ
: Input files.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.res
: Resource files used by tests.
Running the tests
# Run all tests
cargo test
# Run unit tests
cargo test --lib
# Run integration tests (the tests in this directory)
cargo test --test typeset
# Run all tests whose names contain the word `filter`
cargo test --test typeset filter
Creating new tests
To keep things small, please optimize reference images before committing them:
# One image
oxipng -o max path/to/image.png
# All images
oxipng -r -o max tests/ref