summaryrefslogtreecommitdiff
path: root/tests/typ/func-page.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-13 14:07:38 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-13 14:07:38 +0100
commit60154474ba1cf4a556bbed7f80ee0947c29dbca8 (patch)
treeb864fb2503c6a49f1c6676db85d6d3397462a35b /tests/typ/func-page.typ
parent539735e668f601058c2c71a847335e17fac107e8 (diff)
Enable multiple tests per file 🧱
Diffstat (limited to 'tests/typ/func-page.typ')
-rw-r--r--tests/typ/func-page.typ59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/typ/func-page.typ b/tests/typ/func-page.typ
new file mode 100644
index 00000000..7f87a414
--- /dev/null
+++ b/tests/typ/func-page.typ
@@ -0,0 +1,59 @@
+// Test configuring page sizes and margins.
+
+// Set width.
+[page width: 50pt][High]
+
+// Set height.
+[page height: 50pt][Wide]
+
+// Set all margins at once.
+[page margins: 40pt][
+ [align top, left][TL]
+ [align bottom, right][BR]
+]
+
+// Set individual margins.
+[page left: 0pt | align left][Left]
+[page right: 0pt | align right][Right]
+[page top: 0pt | align top][Top]
+[page bottom: 0pt | align bottom][Bottom]
+
+// Ensure that specific margins override general margins.
+[page margins: 0pt, left: 40pt][Overriden]
+
+// Flip the page.
+[page "a10", flip: true][Flipped]
+
+---
+// Test a combination of pages with bodies and normal content.
+
+[page height: 50pt]
+
+[page][First]
+[page][Second]
+[pagebreak]
+Fourth
+[page][]
+Sixth
+[page][Seventh and last]
+
+
+---
+// Test changing the layouting directions of pages.
+
+[page main-dir: btt, cross-dir: rtl]
+
+Right to left!
+
+---
+// Test error cases.
+//
+// ref: false
+// error: 3:7-3:18 unknown variable
+// error: 6:17-6:20 aligned axis
+
+// Invalid paper.
+[page nonexistant]
+
+// Aligned axes.
+[page main-dir: ltr]