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)
|
|
|
|
|
2020-04-27 13:16:11 +00:00
|
|
|
{.used.}
|
|
|
|
|
2020-04-06 16:24:15 +00:00
|
|
|
import eth/keyfile/uuid, unittest
|
2019-02-05 10:45:09 +00:00
|
|
|
|
|
|
|
suite "Cross-platform UUID test suite":
|
|
|
|
test "Platform UUID check":
|
2020-04-06 16:24:15 +00:00
|
|
|
check uuidGenerate().isOk
|
|
|
|
|
2019-02-05 10:45:09 +00:00
|
|
|
test "Conversion test":
|
2020-04-06 16:24:15 +00:00
|
|
|
let u = uuidGenerate()[]
|
2019-02-05 10:45:09 +00:00
|
|
|
check:
|
|
|
|
len($u) == 36
|
2020-04-06 16:24:15 +00:00
|
|
|
$uuidFromString($u)[] == $u
|
|
|
|
uuidToString(u) == $u
|