tbitops_utils.nim 300 B

12345678910111213141516
  1. import std/private/bitops_utils
  2. import std/assertions
  3. template chk(a, b) =
  4. let a2 = castToUnsigned(a)
  5. doAssert a2 == b
  6. doAssert type(a2) is type(b)
  7. doAssert type(b) is type(a2)
  8. chk 1'i8, 1'u8
  9. chk -1'i8, 255'u8
  10. chk 1'u8, 1'u8
  11. chk 1'u, 1'u
  12. chk -1, cast[uint](-1)
  13. chk -1'i64, cast[uint64](-1)