Add test for string <-> Uint/Int

This commit is contained in:
coffeepots 2018-04-17 15:56:57 +01:00
parent 0d547441d1
commit 2609cbbeef
1 changed files with 10 additions and 0 deletions

View File

@ -1,6 +1,16 @@
import ttmath, unittest, strutils
suite "ttmath":
test "String <-> Int":
let
a = i256"123456789012345679801234"
strVal = $a
check strVal == "123456789012345679801234"
test "String <-> UInt":
let
a = u256"123456789012345679801234"
strVal = $a
check strVal == "123456789012345679801234"
test "Ints":
let a = i256"12345678910111213141516"
let b = i256"16151413121110987654321"