diff --git a/tests/README.md b/tests/README.md index 7d9c3edac..424c97d8d 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,7 +1,10 @@ # Tests -- `typ`: Input files -- `ref`: Reference images which the output is compared with to determine - whether a test passed or failed -- `res`: Resource files used by tests -- `out`: PNG and PDF files produced by tests +- `typ`: Input files. +- `ref`: Reference images which the output is compared with to determine whether + a test passed or failed. To keep things small, please run + `oxipng -o max tests/ref/` when creating or updating reference + images (note that `` can be `*` to optimize all images). +- `res`: Resource files used by tests. +- `out`: PNG and PDF files produced by tests. + diff --git a/tests/ref/page-body.png b/tests/ref/page-body.png index a3b3d7264..09f685c33 100644 Binary files a/tests/ref/page-body.png and b/tests/ref/page-body.png differ diff --git a/tests/ref/pagebreak.png b/tests/ref/pagebreak.png new file mode 100644 index 000000000..50686ff97 Binary files /dev/null and b/tests/ref/pagebreak.png differ diff --git a/tests/typ/image-error.typ b/tests/typ/image-error.typ index 9a7f2c400..e6a989cac 100644 --- a/tests/typ/image-error.typ +++ b/tests/typ/image-error.typ @@ -1,11 +1,11 @@ // Test error cases of the `image` function. -// compare-ref: false -// error: 8:9-8:30 failed to load image -// error: 11:9-11:30 failed to load image - // File does not exist. [image: "path/does/not/exist"] // File exists, but is no image. [image: "typ/image-error.typ"] + +// compare-ref: false +// error: 4:9-4:30 failed to load image +// error: 7:9-7:30 failed to load image diff --git a/tests/typ/page-body.typ b/tests/typ/page-body.typ index 6067dcfee..78e72d12b 100644 --- a/tests/typ/page-body.typ +++ b/tests/typ/page-body.typ @@ -6,6 +6,6 @@ [page][Second] [pagebreak] Fourth -[page][Fifth] +[page][] Sixth [page][Seventh and last] diff --git a/tests/typ/page-error.typ b/tests/typ/page-error.typ index dee5c449d..e259a04e4 100644 --- a/tests/typ/page-error.typ +++ b/tests/typ/page-error.typ @@ -1,11 +1,11 @@ // Test error cases of the `page` function. -// compare-ref: false -// error: 8:8-8:19 invalid paper -// error: 11:17-11:20 aligned axis - // Invalid paper. [page: nonexistant] // Aligned axes. [page: main-dir=ltr] + +// compare-ref: false +// error: 4:8-4:19 invalid paper +// error: 7:17-7:20 aligned axis diff --git a/tests/typ/pagebreak.typ b/tests/typ/pagebreak.typ new file mode 100644 index 000000000..7fd9aae2c --- /dev/null +++ b/tests/typ/pagebreak.typ @@ -0,0 +1,5 @@ +// Test trailing pagebreak. + +First of two +[pagebreak] +[page: height=40pt]