Fix countLeapYears
This commit is contained in:
parent
1063085850
commit
f2ba3d174c
2 changed files with 7 additions and 1 deletions
|
|
@ -235,3 +235,9 @@ block dstTest:
|
|||
parsedJul = parse("2016-07-01 04:00:00+01:00", "yyyy-MM-dd HH:mm:sszzz")
|
||||
doAssert toTime(parsedJan) == fromSeconds(1451962800)
|
||||
doAssert toTime(parsedJul) == fromSeconds(1467342000)
|
||||
|
||||
block countLeapYears:
|
||||
# 1920, 2004 and 2020 are leap years, and should be counted starting at the following year
|
||||
doAssert countLeapYears(1920) + 1 == countLeapYears(1921)
|
||||
doAssert countLeapYears(2004) + 1 == countLeapYears(2005)
|
||||
doAssert countLeapYears(2020) + 1 == countLeapYears(2021)
|
||||
Loading…
Add table
Add a link
Reference in a new issue