nim-stew/tests/test_staticfor.nim
Jacek Sieka 41f48efee9
staticfor: compile-time loop unrolling (#232)
* staticfor: compile-time loop unrolling

* better code, preserve line info

* one more line info

* license
2024-09-24 10:36:50 +02:00

17 lines
231 B
Nim

{.used.}
import unittest2, ../stew/staticfor
suite "staticfor":
test "basics":
var
a = 0
b = 0
for i in 0..10:
a += i
staticFor i, 0..10:
b += default(array[i, byte]).len
check: a == b