summaryrefslogtreecommitdiff
path: root/tests/typ/code/ops-invalid.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-05-04 22:14:51 +0200
committerLaurenz <laurmaedje@gmail.com>2022-05-04 22:14:51 +0200
commit75472fee1a2377f56551fc856cf7511bd55091f0 (patch)
tree72b221fd2bd3ddd2dceb6b443d480fcae9298932 /tests/typ/code/ops-invalid.typ
parentba5622b7b90b23e61942a9f4e6460bf9ea0b4bc8 (diff)
Division for lengths
Diffstat (limited to 'tests/typ/code/ops-invalid.typ')
-rw-r--r--tests/typ/code/ops-invalid.typ24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ
index 4e7fdb04..3e9e5478 100644
--- a/tests/typ/code/ops-invalid.typ
+++ b/tests/typ/code/ops-invalid.typ
@@ -39,6 +39,26 @@
{(1 + "2", 40% - 1)}
---
+// Error: 14-22 cannot add integer and string
+{ let x = 1; x += "2" }
+
+---
+// Error: 3-12 cannot divide ratio by length
+{ 10% / 5pt }
+
+---
+// Error: 3-12 cannot divide these two lengths
+{ 1em / 5pt }
+
+---
+// Error: 3-19 cannot divide relative length by ratio
+{ (10% + 1pt) / 5% }
+
+---
+// Error: 3-28 cannot divide these two relative lengths
+{ (10% + 1pt) / (20% + 1pt) }
+
+---
// Error: 12-19 cannot subtract integer from ratio
{(1234567, 40% - 1)}
@@ -65,10 +85,6 @@
}
---
-// Error: 14-22 cannot add integer and string
-{ let x = 1; x += "2" }
-
----
// Error: 3-6 cannot mutate a temporary value
{ (x) = "" }