summary refs log tree commit diff stats
path: root/tests/run
diff options
context:
space:
mode:
authorGrzegorz Adam Hankiewicz <gradha@imap.cc>2012-12-13 19:28:34 +0100
committerGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-01-03 22:38:56 +0100
commitbd961fd76c1d61586ccdebc8abafa401ad3428e3 (patch)
tree56dfb3cd9a89c309beb5e8d4d15ad76925d03c71 /tests/run
parent77492158aca520b6f5192885147953aa35e830b2 (diff)
downloadNim-bd961fd76c1d61586ccdebc8abafa401ad3428e3.tar.gz
Moves toSeq template to public sequtils module.
Diffstat (limited to 'tests/run')
-rwxr-xr-xtests/run/ttoseq.nim11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/run/ttoseq.nim b/tests/run/ttoseq.nim
index ec49489d0..34cc4824b 100755
--- a/tests/run/ttoseq.nim
+++ b/tests/run/ttoseq.nim
@@ -1,12 +1,11 @@
 discard """
-  output: "23456"  
+  output: "2345623456"
 """
 
-template toSeq*(iter: expr): expr {.immediate.} =
-  var result: seq[type(iter)] = @[]
-  for x in iter: add(result, x)
-  result
-  
+import sequtils
+
+for x in toSeq(countup(2, 6)): 
+  stdout.write(x)
 for x in items(toSeq(countup(2, 6))): 
   stdout.write(x)