From c7416f18bdddf48f4535a6d48927c2355d842af9 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 9 Jun 2021 10:51:19 +0200 Subject: Move invalid syntax tests into appropriate places --- tests/typ/code/while.typ | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/typ/code/while.typ') 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 -- cgit v1.2.3