diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-14 09:56:24 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-14 09:56:24 +0100 |
| commit | ad66fbdfa2d39e39c2a7d7411e27cb61ada2b648 (patch) | |
| tree | 7cf6395ef27d09c3603ae138af8d1aa45842a404 /tests/typ/compiler/while.typ | |
| parent | 2271d67f8f5fe65882e74622ad01c075102725b1 (diff) | |
Detect infinite loops
Diffstat (limited to 'tests/typ/compiler/while.typ')
| -rw-r--r-- | tests/typ/compiler/while.typ | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/typ/compiler/while.typ b/tests/typ/compiler/while.typ index 5dc5ae41..3c28a32a 100644 --- a/tests/typ/compiler/while.typ +++ b/tests/typ/compiler/while.typ @@ -34,11 +34,13 @@ #while [nope] [nope] --- -// Make sure that we terminate and don't complain multiple times. -#while true { - // Error: 3-7 unknown variable - nope -} +// Error: 8-25 condition is always true +#while 2 < "hello".len() {} + +--- +// Error: 2:1-2:24 loop seems to be infinite +#let i = 1 +#while i > 0 { i += 1 } --- // Error: 7 expected expression |
