catch a bug in while loops

This commit is contained in:
2023-07-10 15:56:23 -06:00
parent 034e83827c
commit fe882d1969
3 changed files with 13 additions and 1 deletions

View File

@@ -675,6 +675,14 @@ From:[(assert false (+ \"false \" \"should \" \"have \" \"been \" \"true\"))]" m
)
(Assert.pass))
(function _testWhile []
(let [max 8
&mut current 0
&mut iterations 0]
(while (>= max (+= current 1))
(+= iterations 1))
(Assert.equals 8 iterations)))
(function _testWhileLet []
(let [&mut idx 0
lines ["a" "b" "c"]