summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-12 23:06:04 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-12 23:06:04 +0100
commit58f799c41cb71f167e6e82eb94b3cde1303de11e (patch)
tree2ac52c93e323b003eaad2f75d353408aaa87d359 /tests
parent790dc9e6670b0d90c9ff68a0981cdbfb7d9c536a (diff)
Early quit loop when body returns error 🛑
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/typ/for-loop.typ7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/lang/typ/for-loop.typ b/tests/lang/typ/for-loop.typ
index 944cef1e..2af7ab04 100644
--- a/tests/lang/typ/for-loop.typ
+++ b/tests/lang/typ/for-loop.typ
@@ -42,3 +42,10 @@
// Make sure that we don't complain twice.
// Error: 12-19 cannot add integer and string
#for v #in 1 + "2" {}
+
+// Error: 14-17 cannot apply '-' to string
+#let error = -""
+#let result = #for v #in (1, 2, 3) {
+ #if v < 2 [Ok] #else {error}
+}
+#[test result, error]