Add parseUInt and parseBiggestUInt functions to stdlib (parseutils, strutils)

This commit is contained in:
Anatoly Galiulin 2016-03-30 17:34:41 +06:00
commit 9aa845c6b6
3 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,11 @@
discard """
action: run
"""
import unittest, strutils
suite "parseutils":
test "uint":
check: parseBiggestUInt("0") == 0'u64
check: parseBiggestUInt("18446744073709551615") == 0xFFFF_FFFF_FFFF_FFFF'u64
expect(ValueError):
discard parseBiggestUInt("18446744073709551616")