summary refs log tree commit diff stats
path: root/tests/stdlib/tparseuints.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-03-31 16:35:25 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-03-31 16:35:25 +0200
commitb296e7c01f3d29e2e429bfc1fc4203727cd3b1ce (patch)
tree5debdaf0b92934af508d9ef2568c654682f6fb64 /tests/stdlib/tparseuints.nim
parentd836028fe7b18c93c9a9751f470da387eab09af1 (diff)
parentc34a68d76f7f552b235592da7634acc333275df9 (diff)
downloadNim-b296e7c01f3d29e2e429bfc1fc4203727cd3b1ce.tar.gz
Merge pull request #4013 from vegansk/parse_uints
parseUInt and parseBiggestUInt functions
Diffstat (limited to 'tests/stdlib/tparseuints.nim')
-rw-r--r--tests/stdlib/tparseuints.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/stdlib/tparseuints.nim b/tests/stdlib/tparseuints.nim
new file mode 100644
index 000000000..5be3bcbd0
--- /dev/null
+++ b/tests/stdlib/tparseuints.nim
@@ -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")