summaryrefslogtreecommitdiff
path: root/tests/typ/elements/square.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-05 18:51:21 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-05 18:51:21 +0200
commitdcdcf53831aa477b575c9e6ab37eb64f14317c74 (patch)
tree43b742ddbcb623254d8d6e6e65d2c432cb7509e8 /tests/typ/elements/square.typ
parent5e06941c63425ab10e08e4d533939c7309cfe6ce (diff)
Rename insert/ to elements/
Diffstat (limited to 'tests/typ/elements/square.typ')
-rw-r--r--tests/typ/elements/square.typ34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/typ/elements/square.typ b/tests/typ/elements/square.typ
new file mode 100644
index 00000000..07dce4be
--- /dev/null
+++ b/tests/typ/elements/square.typ
@@ -0,0 +1,34 @@
+// Test the `square` function.
+
+---
+// Test auto-sized square.
+#square(fill: eastern)[
+ #font(fill: white, weight: bold)
+ #align(center)
+ #pad(5pt)[Typst]
+]
+---
+// Test relative-sized child.
+#square(fill: eastern)[
+ #rect(width: 10pt, height: 5pt, fill: conifer) \
+ #rect(width: 40%, height: 5pt, fill: conifer)
+]
+
+---
+// Test height overflow.
+#page(width: 75pt, height: 100pt)
+#square(fill: conifer)[
+ But, soft! what light through yonder window breaks?
+]
+
+---
+// Test width overflow.
+#page(width: 100pt, height: 75pt)
+#square(fill: conifer)[
+ But, soft! what light through yonder window breaks?
+]
+
+---
+// Length wins over width and height.
+// Error: 09-20 unexpected argument
+#square(width: 10cm, height: 20cm, length: 1cm, fill: rgb("eb5278"))