Add parseUInt and parseBiggestUInt functions to stdlib (parseutils, strutils)
This commit is contained in:
parent
3b732259c0
commit
9aa845c6b6
3 changed files with 80 additions and 0 deletions
11
tests/stdlib/tparseuints.nim
Normal file
11
tests/stdlib/tparseuints.nim
Normal 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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue