Arnaud 2dd97631ed
chore: update nim 2.2.8 (#1424)
Signed-off-by: Arnaud <arno.deville@gmail.com>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2026-04-22 13:57:14 +00:00

18 lines
434 B
Nim

import pkg/unittest2
import storage/clock
suite "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)