diff --git a/test/ttimeutils.nim b/test/ttimeutils.nim index e3d9a44..3dfae87 100644 --- a/test/ttimeutils.nim +++ b/test/ttimeutils.nim @@ -9,11 +9,17 @@ suite "timeutils": interval.format("mm:ss") == "01:10" test "TimeInfo difference": - let t1 = getLocalTime(getTime()) - let t2 = t1 + 30.seconds - + var t1 = getLocalTime(getTime()) + var t2 = t1 + 30.seconds check t2 - t1 == 30.seconds + t1 = parse("2016-10-10 09:45:00", "yyyy-MM-dd HH:mm:ss") + t2 = parse("2016-10-11 09:45:00", "yyyy-MM-dd HH:mm:ss") + check t2 - t1 == 1.days + + t2 = parse("2016-10-11 10:00:00", "yyyy-MM-dd HH:mm:ss") + check t2 - t1 == (1.days + 15.minutes) + test "TimeInfo comparisons": let t1 = getLocalTime(getTime()) diff --git a/timeutils.nimble b/timeutils.nimble index cf70893..21a5aef 100644 --- a/timeutils.nimble +++ b/timeutils.nimble @@ -1,6 +1,6 @@ # Package -version = "0.1.0" +version = "0.1.1" author = "Jonathan Bernard" description = "Utility methods to fill in the horrid time support in Nim\'s stdlib. This is holding me over until I can write a proper time module for the stdlib and submit it." license = "BSD3"