summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalo <57839069+MDLC01@users.noreply.github.com>2025-02-25 15:19:17 +0100
committerGitHub <noreply@github.com>2025-02-25 14:19:17 +0000
commitd6b0d68ffa4963459f52f7d774080f1f128841d4 (patch)
tree962bfc845f46157b3d0a62add392aa8c6fc2d0ce /tests
parent8f039dd614ba518976b8b486e0a138bd6a9c660c (diff)
Add more methods to `direction` (#5893)
Diffstat (limited to 'tests')
-rw-r--r--tests/suite/layout/dir.typ27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/suite/layout/dir.typ b/tests/suite/layout/dir.typ
index 139a2285..e6db54da 100644
--- a/tests/suite/layout/dir.typ
+++ b/tests/suite/layout/dir.typ
@@ -1,10 +1,35 @@
+--- dir-from ---
+#test(direction.from(left), ltr)
+#test(direction.from(right), rtl)
+#test(direction.from(top), ttb)
+#test(direction.from(bottom), btt)
+
+--- dir-from-invalid ---
+// Error: 17-23 cannot convert this alignment to a side
+#direction.from(center)
+
+--- dir-to ---
+#test(direction.to(left), rtl)
+#test(direction.to(right), ltr)
+#test(direction.to(top), btt)
+#test(direction.to(bottom), ttb)
+
+-- dir-to-invalid ---
+// Error: 15-21 cannot convert this alignment to a side
+#direction.to(center)
+
--- dir-axis ---
-// Test direction methods.
#test(ltr.axis(), "horizontal")
#test(rtl.axis(), "horizontal")
#test(ttb.axis(), "vertical")
#test(btt.axis(), "vertical")
+--- dir-sign ---
+#test(ltr.sign(), 1)
+#test(rtl.sign(), -1)
+#test(ttb.sign(), 1)
+#test(btt.sign(), -1)
+
--- dir-start ---
#test(ltr.start(), left)
#test(rtl.start(), right)