mirror of
https://github.com/status-im/nim-stew.git
synced 2025-01-09 11:45:42 +00:00
41f48efee9
* staticfor: compile-time loop unrolling * better code, preserve line info * one more line info * license
17 lines
231 B
Nim
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 |