summaryrefslogtreecommitdiff
path: root/tests/typ/compiler/ops-invalid.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-17 16:32:48 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-17 16:32:48 +0100
commit028632a3a10202ee21eaaf7ecf13ca7fe331106e (patch)
treeecba2b74b52b2c94b8ccf63dc8099d8ef608081c /tests/typ/compiler/ops-invalid.typ
parentdd5f07eb9110cc5e19dcb4441743a323128426fc (diff)
Fix error handling after hashtag
Diffstat (limited to 'tests/typ/compiler/ops-invalid.typ')
-rw-r--r--tests/typ/compiler/ops-invalid.typ68
1 files changed, 34 insertions, 34 deletions
diff --git a/tests/typ/compiler/ops-invalid.typ b/tests/typ/compiler/ops-invalid.typ
index 3356a24c..8ccbb8b7 100644
--- a/tests/typ/compiler/ops-invalid.typ
+++ b/tests/typ/compiler/ops-invalid.typ
@@ -3,7 +3,7 @@
---
// Error: 4 expected expression
-#{-}
+#(-)
---
// Error: 10 expected expression
@@ -15,40 +15,40 @@
---
// Error: 3-13 cannot apply '+' to content
-#{+([] + [])}
+#(+([] + []))
---
// Error: 3-6 cannot apply '-' to string
-#{-""}
+#(-"")
---
// Error: 3-9 cannot apply 'not' to array
-#{not ()}
+#(not ())
---
// Error: 3-19 cannot apply '<=' to relative length and ratio
-#{30% + 1pt <= 40%}
+#(30% + 1pt <= 40%)
---
// Error: 3-14 cannot apply '<=' to length and length
-#{1em <= 10pt}
+#(1em <= 10pt)
---
// Error: 3-12 cannot divide by zero
-#{1.2 / 0.0}
+#(1.2 / 0.0)
---
// Error: 3-8 cannot divide by zero
-#{1 / 0}
+#(1 / 0)
---
// Error: 3-15 cannot divide by zero
-#{15deg / 0deg}
+#(15deg / 0deg)
---
// Special messages for +, -, * and /.
-// Error: 4-11 cannot add integer and string
-#{(1 + "2", 40% - 1)}
+// Error: 3-10 cannot add integer and string
+#(1 + "2", 40% - 1)
---
// Error: 15-23 cannot add integer and string
@@ -56,35 +56,35 @@
---
// Error: 4-13 cannot divide ratio by length
-#{ 10% / 5pt }
+#( 10% / 5pt )
---
-// Error: 4-13 cannot divide these two lengths
-#{ 1em / 5pt }
+// Error: 3-12 cannot divide these two lengths
+#(1em / 5pt)
---
-// Error: 4-20 cannot divide relative length by ratio
-#{ (10% + 1pt) / 5% }
+// Error: 3-19 cannot divide relative length by ratio
+#((10% + 1pt) / 5%)
---
-// Error: 4-29 cannot divide these two relative lengths
-#{ (10% + 1pt) / (20% + 1pt) }
+// Error: 3-28 cannot divide these two relative lengths
+#((10% + 1pt) / (20% + 1pt))
---
// Error: 13-20 cannot subtract integer from ratio
-#{(1234567, 40% - 1)}
+#((1234567, 40% - 1))
---
// Error: 3-11 cannot multiply integer with boolean
-#{2 * true}
+#(2 * true)
---
// Error: 3-11 cannot divide integer by length
-#{3 / 12pt}
+#(3 / 12pt)
---
// Error: 3-10 cannot repeat this string -1 times
-#{-1 * ""}
+#(-1 * "")
---
#{
@@ -97,32 +97,32 @@
}
---
-// Error: 5-6 unknown variable
-#{ (x) = "" }
+// Error: 4-5 unknown variable
+#((x) = "")
---
-// Error: 4-9 cannot mutate a temporary value
-#{ 1 + 2 += 3 }
+// Error: 3-8 cannot mutate a temporary value
+#(1 + 2 += 3)
---
// Error: 2:3-2:8 cannot apply 'not' to string
#let x = "Hey"
-#{not x = "a"}
+#(not x = "a")
---
-// Error: 8-9 unknown variable
-#{ 1 + x += 3 }
+// Error: 7-8 unknown variable
+#(1 + x += 3)
---
-// Error: 4-5 unknown variable
-#{ z = 1 }
+// Error: 3-4 unknown variable
+#(z = 1)
---
-// Error: 4-8 cannot mutate a constant
-#{ rect = "hi" }
+// Error: 3-7 cannot mutate a constant
+#(rect = "hi")
---
// Works if we define rect beforehand
// (since then it doesn't resolve to the standard library version anymore).
#let rect = ""
-#{ rect = "hi" }
+#(rect = "hi")