nim-eth/tests/keyfile/test_uuid.nim

24 lines
632 B
Nim
Raw Normal View History

2019-02-05 10:45:09 +00:00
#
# Ethereum KeyFile
# (c) Copyright 2018
# Status Research & Development GmbH
#
# Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2)
# MIT license (LICENSE-MIT)
2019-02-05 14:22:21 +00:00
import eth/keyfile/uuid, strutils, unittest
2019-02-05 10:45:09 +00:00
suite "Cross-platform UUID test suite":
test "Platform UUID check":
var u: UUID
check uuidGenerate(u) == 1
test "Conversion test":
var u: UUID
check:
uuidGenerate(u) == 1
len($u) == 36
$uuidFromString($u) == $u
uuidToString(u, true) == $u
uuidToString(u, false) == toUpperAscii($u)