nim-dagger/tests/codex/testclock.nim
Dmitriy Ryajov 276bf5ed4f
refactor: async error handling and future tracking improvements
- Update async procedures to use explicit raises annotation
- Modify TrackedFutures to handle futures with no raised exceptions
- Replace `asyncSpawn` with explicit future tracking
- Update test suites to use `unittest2`
- Standardize error handling across network and async components
- Remove deprecated error handling patterns

This commit introduces a more robust approach to async error handling and future management, improving type safety and reducing potential runtime errors.
2025-02-26 18:17:19 -06:00

19 lines
449 B
Nim

import pkg/unittest2
import codex/clock
import ./helpers
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)