fixed a bug in map for sets

This commit is contained in:
Simon Hafner
2014-02-10 13:02:47 -06:00
parent 56c41ae140
commit e8c87d070a
2 changed files with 7 additions and 3 deletions

View File

@@ -1,13 +1,17 @@
discard """
output: '''true'''
output: '''true
true'''
"""
import sets
var
a = initSet[int]()
b = initSet[int]()
c = initSet[string]()
for i in 0..5: a.incl(i)
for i in 1..6: b.incl(i)
for i in 0..5: c.incl($i)
echo map(a, proc(x: int): int = x + 1) == b
echo map(a, proc(x: int): string = $x) == c