summaryrefslogtreecommitdiff
path: root/tests/typ/utility
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-07-30 18:04:08 +0200
committerLaurenz <laurmaedje@gmail.com>2021-07-30 18:49:19 +0200
commit1ee1d078e2480ddd08d40915bc7a74a8352acff0 (patch)
tree1e7ff367278a19fead3e404cf06d65bfb80a6cd9 /tests/typ/utility
parent42a27b48df427edf8dbb624c51551a90ecf2e7ea (diff)
Fatal errors
- Makes errors fatal, so that a phase is only reached when all previous phases were error-free - Parsing still recovers and can produce multiple errors - Evaluation fails fast and can thus produce only a single error (except for parse errors due to an import) - The single error that could occur during execution is removed for now - Removes Value::Error variant
Diffstat (limited to 'tests/typ/utility')
-rw-r--r--tests/typ/utility/basics.typ3
-rw-r--r--tests/typ/utility/color.typ17
-rw-r--r--tests/typ/utility/math.typ2
3 files changed, 13 insertions, 9 deletions
diff --git a/tests/typ/utility/basics.typ b/tests/typ/utility/basics.typ
index 75e06413..25cac039 100644
--- a/tests/typ/utility/basics.typ
+++ b/tests/typ/utility/basics.typ
@@ -3,14 +3,15 @@
---
// Test the `len` function.
-
#test(len(()), 0)
#test(len(("A", "B", "C")), 3)
#test(len("Hello World!"), 12)
#test(len((a: 1, b: 2)), 2)
+---
// Error: 6 missing argument: collection
#len()
+---
// Error: 6-10 expected string, array or dictionary
#len(12pt)
diff --git a/tests/typ/utility/color.typ b/tests/typ/utility/color.typ
index 8f4c0522..5b10477f 100644
--- a/tests/typ/utility/color.typ
+++ b/tests/typ/utility/color.typ
@@ -11,13 +11,14 @@
// Clamped.
#test(rgb(-30, 15.5, 0.5), rgb("00ff80"))
-// Error: 11-15 missing argument: blue component
-#test(rgb(0, 1), rgb("00ff00"))
+---
+// Error: 6-11 invalid color
+#rgb("lol")
-// Error: 11-16 invalid color
-#test(rgb("lol"), error)
+---
+// Error: 6 missing argument: red component
+#rgb()
-// Error: 11 missing argument: red component
-// Error: 11 missing argument: green component
-// Error: 11 missing argument: blue component
-#test(rgb(), black)
+---
+// Error: 6-10 missing argument: blue component
+#rgb(0, 1)
diff --git a/tests/typ/utility/math.typ b/tests/typ/utility/math.typ
index db234d9c..933f882f 100644
--- a/tests/typ/utility/math.typ
+++ b/tests/typ/utility/math.typ
@@ -8,8 +8,10 @@
#test(max(-3, 11), 11)
#test(min("hi"), "hi")
+---
// Error: 6 missing argument: value
#min()
+---
// Error: 11-18 cannot compare integer with string
#test(min(1, "hi"), error)