summaryrefslogtreecommitdiff
path: root/tests/typ/text/align.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-04-03 20:54:18 +0200
committerLaurenz <laurmaedje@gmail.com>2021-04-03 21:12:32 +0200
commitbfbbe8dcf8881d276c3db05aea99f7da915edde2 (patch)
tree505b701eb8e0135a2c7e4b4da79caa301cffa07e /tests/typ/text/align.typ
parent9014e834785aeae4af264c4e8c2c2141ead4788a (diff)
Better paragraph layout tests ✅
Diffstat (limited to 'tests/typ/text/align.typ')
-rw-r--r--tests/typ/text/align.typ28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/typ/text/align.typ b/tests/typ/text/align.typ
new file mode 100644
index 00000000..27c650a4
--- /dev/null
+++ b/tests/typ/text/align.typ
@@ -0,0 +1,28 @@
+// Test text alignment.
+
+---
+// Test that alignment depends on the paragraph's full width.
+#rect[
+ Hello World \
+ #align(right)[World]
+]
+
+---
+// Test that a line with multiple alignments respects the paragraph's full
+// width.
+#rect[
+ Hello #align(center)[World] \
+ Hello from the World
+]
+
+---
+// Test that `start` alignment after `end` alignment doesn't do anything until
+// the next line break ...
+L #align(right)[R] R
+
+// ... but make sure it resets to left after the line break.
+L #align(right)[R] \ L
+
+---
+// FIXME: There should be a line break opportunity on alignment change.
+LLLLLLLLLLLLL#align(center)[CCCC]