summaryrefslogtreecommitdiff
path: root/tests/typ/visualize/shape-square.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-29 13:37:25 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-29 14:18:13 +0100
commit0efe669278a5e1c3f2985eba2f3360e91159c54a (patch)
tree502712857c48f0decb5e698257c0a96d358a436e /tests/typ/visualize/shape-square.typ
parent836692e73cff0356e409a9ba5b4887b86809d4ca (diff)
Reorganize library and tests
Diffstat (limited to 'tests/typ/visualize/shape-square.typ')
-rw-r--r--tests/typ/visualize/shape-square.typ39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/typ/visualize/shape-square.typ b/tests/typ/visualize/shape-square.typ
new file mode 100644
index 00000000..622fa9c8
--- /dev/null
+++ b/tests/typ/visualize/shape-square.typ
@@ -0,0 +1,39 @@
+// Test the `square` function.
+
+---
+// Default square.
+#square()
+#square[hey!]
+
+---
+// Test auto-sized square.
+#square(fill: eastern, inset: 5pt)[
+ #set text(fill: white, weight: "bold")
+ Typst
+]
+
+---
+// Test relative-sized child.
+#square(fill: eastern)[
+ #rect(width: 10pt, height: 5pt, fill: conifer) \
+ #rect(width: 40%, height: 5pt, stroke: conifer)
+]
+
+---
+// Test text overflowing height.
+#set page(width: 75pt, height: 100pt)
+#square(fill: conifer)[
+ But, soft! what light through yonder window breaks?
+]
+
+---
+// Test that square does not overflow page.
+#set page(width: 100pt, height: 75pt)
+#square(fill: conifer)[
+ But, soft! what light through yonder window breaks?
+]
+
+---
+// Size wins over width and height.
+// Error: 09-20 unexpected argument
+#square(width: 10cm, height: 20cm, size: 1cm, fill: rgb("eb5278"))