summary refs log tree commit diff stats
path: root/tests/collections/tsets.nim
blob: 656c5b3f2d21aa0700de26c69b2d4864ed2dd597 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  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