diff options
Diffstat (limited to 'tests/stdlib/ttimes.nim')
-rw-r--r-- | tests/stdlib/ttimes.nim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/stdlib/ttimes.nim b/tests/stdlib/ttimes.nim index f35965286..945d7ba3d 100644 --- a/tests/stdlib/ttimes.nim +++ b/tests/stdlib/ttimes.nim @@ -409,4 +409,11 @@ suite "ttimes": # Bug with adding a day to a Time let day = 24.hours let tomorrow = now + day - check tomorrow - now == initDuration(days = 1) \ No newline at end of file + check tomorrow - now == initDuration(days = 1) + + test "fromWinTime/toWinTime": + check 0.fromUnix.toWinTime.fromWinTime.toUnix == 0 + check (-1).fromWinTime.nanoseconds == convert(Seconds, Nanoseconds, 1) - 100 + check -1.fromWinTime.toWinTime == -1 + # One nanosecond is discarded due to differences in time resolution + check initTime(0, 101).toWinTime.fromWinTime.nanoseconds == 100 \ No newline at end of file |