More unit tests (cover previous bug in Nim times library).
This commit is contained in:
parent
6067740bdd
commit
cb11d62e5d
@ -9,11 +9,17 @@ suite "timeutils":
|
|||||||
interval.format("mm:ss") == "01:10"
|
interval.format("mm:ss") == "01:10"
|
||||||
|
|
||||||
test "TimeInfo difference":
|
test "TimeInfo difference":
|
||||||
let t1 = getLocalTime(getTime())
|
var t1 = getLocalTime(getTime())
|
||||||
let t2 = t1 + 30.seconds
|
var t2 = t1 + 30.seconds
|
||||||
|
|
||||||
check 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":
|
test "TimeInfo comparisons":
|
||||||
let t1 = getLocalTime(getTime())
|
let t1 = getLocalTime(getTime())
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
author = "Jonathan Bernard"
|
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."
|
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"
|
license = "BSD3"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user