summaryrefslogtreecommitdiff
path: root/tests/typ/code/while.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-09 10:51:19 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-09 10:51:19 +0200
commitc7416f18bdddf48f4535a6d48927c2355d842af9 (patch)
tree2730265f83bd98d8f670ac47588d499a43c1ad92 /tests/typ/code/while.typ
parentedff2ae6803928e59eae96e2f75cd62a7e24c76f (diff)
Move invalid syntax tests into appropriate places
Diffstat (limited to 'tests/typ/code/while.typ')
-rw-r--r--tests/typ/code/while.typ22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/typ/code/while.typ b/tests/typ/code/while.typ
index acf7951e..e55f8f10 100644
--- a/tests/typ/code/while.typ
+++ b/tests/typ/code/while.typ
@@ -22,10 +22,13 @@
---
// Value of while loops.
// Ref: false
+
#test(type(while false {}), "template")
#test(type(while false []), "template")
---
+// Ref: false
+
// Condition must be boolean.
// Error: 8-14 expected boolean, found template
#while [nope] [nope]
@@ -41,3 +44,22 @@
if i < 5 [nope] else { error }
})
#test(i, 5)
+
+---
+// Error: 7 expected expression
+#while
+
+// Error: 7 expected expression
+{while}
+
+// 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