summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run/tunittests.nim4
-rw-r--r--tests/run/uclosures.nim3
2 files changed, 3 insertions, 4 deletions
diff --git a/tests/run/tunittests.nim b/tests/run/tunittests.nim
index e4c92c9e9..c77f691d9 100644
--- a/tests/run/tunittests.nim
+++ b/tests/run/tunittests.nim
@@ -1,3 +1 @@
-import utemplates
-
-# uclosures
+import utemplates, uclosures
diff --git a/tests/run/uclosures.nim b/tests/run/uclosures.nim
index d54b88285..6eea29ca1 100644
--- a/tests/run/uclosures.nim
+++ b/tests/run/uclosures.nim
@@ -4,7 +4,8 @@ test "loop variables are captured by copy":
   var funcs: seq[proc (): int {.closure.}] = @[]
   
   for i in 0..10:
-    funcs.add do -> int: return i * i
+    let ii = i
+    funcs.add do -> int: return ii * ii
 
   check funcs[0]() == 0
   check funcs[3]() == 9