summaryrefslogtreecommitdiff
path: root/tests/typ/code/while.typ
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/code/while.typ
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/code/while.typ')
-rw-r--r--tests/typ/code/while.typ21
1 files changed, 6 insertions, 15 deletions
diff --git a/tests/typ/code/while.typ b/tests/typ/code/while.typ
index 306c1e45..2f0984d2 100644
--- a/tests/typ/code/while.typ
+++ b/tests/typ/code/while.typ
@@ -29,23 +29,16 @@
#test(type(while i < 1 [{ i += 1 }]), "template")
---
-// Ref: false
-
// Condition must be boolean.
// Error: 8-14 expected boolean, found template
#while [nope] [nope]
-// Make sure that we don't complain twice.
-// Error: 8-15 unknown variable
-#while nothing {}
-
-// Errors taint everything.
-#let i = 0
-#test(error, while i < 10 {
- i += 1
- if i < 5 [nope] else { error }
-})
-#test(i, 10)
+---
+// Make sure that we terminate and don't complain multiple times.
+#while true {
+ // Error: 5-9 unknown variable
+ nope
+}
---
// Error: 7 expected expression
@@ -57,11 +50,9 @@
// Error: 9 expected body
#while x
-// Should output `x`.
// Error: 7 expected expression
#while
x {}
-// Should output `something`.
// Error: 9 expected body
#while x something