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.}
|
|
|
|
|
2021-04-06 11:33:24 +00:00
|
|
|
import
|
|
|
|
unittest,
|
|
|
|
../../eth/keyfile/uuid
|
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
|