summary refs log tree commit diff stats
path: root/tests/stdlib/mintsets.nim
blob: 98786e9ba5d651ea80ac85d67bd66ae947bcecde (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import std/intsets
import std/assertions

proc test1*[]() =
  let a = initIntSet()
  doAssert len(a) == 0

proc test2*[]() =
  var a = initIntSet()
  var b = initIntSet()
  a.incl b
an class="mi">0}; for (size_t idx = 0; phrase[idx] != '\0'; idx++) { unsigned char cur = tolower((unsigned char) phrase[idx]); if ('a' <= cur & cur <= 'z') { size_t s_idx = cur - 'a'; if (seen[s_idx]) return false; else seen[s_idx] = true; } } return true; }