diff options
author | Oscar NihlgÄrd <oscarnihlgard@gmail.com> | 2018-04-25 02:43:26 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-04-25 02:43:26 +0200 |
commit | b34580fd5b955dec510f1aa06c3db1e4af052ef8 (patch) | |
tree | 1e043d10868e43684592d13bbf2c7a8b47e5c099 /tests | |
parent | c385391ffd08d61738392efa2be334b2ceb5517f (diff) | |
download | Nim-b34580fd5b955dec510f1aa06c3db1e4af052ef8.tar.gz |
Rename `Time.nanoseconds` to `nanosecond` (#7673)
* Rename `Time.nanoseconds` to `nanosecond` * Fix bug with Duration comparision
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/ttimes.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/stdlib/ttimes.nim b/tests/stdlib/ttimes.nim index 945d7ba3d..37e14c1e2 100644 --- a/tests/stdlib/ttimes.nim +++ b/tests/stdlib/ttimes.nim @@ -367,6 +367,10 @@ suite "ttimes": check d(seconds = 0) - d(milliseconds = 1500) == d(milliseconds = -1500) check d(milliseconds = -1500) == d(seconds = -1, milliseconds = -500) check d(seconds = -1, milliseconds = 500) == d(milliseconds = -500) + check initDuration(seconds = 1, nanoseconds = 2) <= + initDuration(seconds = 1, nanoseconds = 3) + check (initDuration(seconds = 1, nanoseconds = 3) <= + initDuration(seconds = 1, nanoseconds = 1)).not test "large/small dates": discard initDateTime(1, mJan, -35_000, 12, 00, 00, utc()) @@ -413,7 +417,7 @@ suite "ttimes": test "fromWinTime/toWinTime": check 0.fromUnix.toWinTime.fromWinTime.toUnix == 0 - check (-1).fromWinTime.nanoseconds == convert(Seconds, Nanoseconds, 1) - 100 + check (-1).fromWinTime.nanosecond == 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 + check initTime(0, 101).toWinTime.fromWinTime.nanosecond == 100 \ No newline at end of file |