mirror of
https://github.com/status-im/nim-codex.git
synced 2025-02-01 13:36:24 +00:00
e5df8c50d3
* style: nph setup * chore: formates codex/ and tests/ folder with nph 0.6.1
19 lines
453 B
Nim
19 lines
453 B
Nim
import std/unittest
|
|
|
|
import codex/clock
|
|
import ./helpers
|
|
|
|
checksuite "Clock":
|
|
proc testConversion(seconds: SecondsSince1970) =
|
|
let asBytes = seconds.toBytes
|
|
|
|
let restored = asBytes.toSecondsSince1970
|
|
|
|
check restored == seconds
|
|
|
|
test "SecondsSince1970 should support bytes conversions":
|
|
let secondsToTest: seq[int64] = @[int64.high, int64.low, 0, 1, 12345, -1, -12345]
|
|
|
|
for seconds in secondsToTest:
|
|
testConversion(seconds)
|