Skip to content

Commit

Permalink
Update test suite for LeapsecondMap and recent years.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbm committed Jul 30, 2017
1 parent 192605d commit 9b2e0c5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ onceCheck = quickCheckWith (stdArgs {maxSuccess = 1})
-- A few trivial tests.
main :: IO ()
main = do
onceCheck $ lst (fromGregorian 1111 12 31) == 0 -- Before first leap second.
onceCheck $ lst (fromGregorian 2008 12 31) == 33
onceCheck $ lst (fromGregorian 2009 01 01) == 34
onceCheck $ lst (fromGregorian 2009 12 31) == 34
onceCheck $ lst (fromGregorian 2012 06 30) == 34 -- Prior to last leap second.
onceCheck $ lst (fromGregorian 2012 07 01) == 35 -- Last leap second.
onceCheck $ lst (fromGregorian 2012 12 31) == 35 -- Beyond last leap second.
onceCheck $ lst (fromGregorian 1111 12 31) == Just 0 -- Before first leap second.
onceCheck $ lst (fromGregorian 2008 12 31) == Just 33
onceCheck $ lst (fromGregorian 2009 01 01) == Just 34
onceCheck $ lst (fromGregorian 2009 12 31) == Just 34
onceCheck $ lst (fromGregorian 2012 06 30) == Just 34
onceCheck $ lst (fromGregorian 2012 07 01) == Just 35
onceCheck $ lst (fromGregorian 2012 12 31) == Just 35
onceCheck $ lst (fromGregorian 2016 12 31) == Just 36 -- Prior to last leap second.
onceCheck $ lst (fromGregorian 2017 01 01) == Just 37 -- Last leap second.
onceCheck $ lst (fromGregorian 2017 12 31) == Just 37 -- Beyond last leap second.

0 comments on commit 9b2e0c5

Please sign in to comment.