summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-12-17 11:31:07 +0100
committerLaurenz <laurmaedje@gmail.com>2020-12-17 11:31:07 +0100
commit0adbfe894ae1252758d1d7fff1df5514824347eb (patch)
tree8a3211ce0eb428cb49a71d85f03ff5b1a5354f81 /tests
parent81e80ecfba80f5bffab45719c1f2aba4f9b91b4f (diff)
Test [pagebreak] 🗞
Diffstat (limited to 'tests')
-rw-r--r--tests/README.md13
-rw-r--r--tests/ref/page-body.pngbin2974 -> 2812 bytes
-rw-r--r--tests/ref/pagebreak.pngbin0 -> 1039 bytes
-rw-r--r--tests/typ/image-error.typ8
-rw-r--r--tests/typ/page-body.typ2
-rw-r--r--tests/typ/page-error.typ8
-rw-r--r--tests/typ/pagebreak.typ5
7 files changed, 22 insertions, 14 deletions
diff --git a/tests/README.md b/tests/README.md
index 7d9c3eda..424c97d8 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/<img>` when creating or updating reference
+ images (note that `<img>` 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 a3b3d726..09f685c3 100644
--- a/tests/ref/page-body.png
+++ b/tests/ref/page-body.png
Binary files differ
diff --git a/tests/ref/pagebreak.png b/tests/ref/pagebreak.png
new file mode 100644
index 00000000..50686ff9
--- /dev/null
+++ b/tests/ref/pagebreak.png
Binary files differ
diff --git a/tests/typ/image-error.typ b/tests/typ/image-error.typ
index 9a7f2c40..e6a989ca 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 6067dcfe..78e72d12 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 dee5c449..e259a04e 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 00000000..7fd9aae2
--- /dev/null
+++ b/tests/typ/pagebreak.typ
@@ -0,0 +1,5 @@
+// Test trailing pagebreak.
+
+First of two
+[pagebreak]
+[page: height=40pt]