[commit: packages/time] format-widths, master, posix-perf, tasty: Get testing working (e63859c)

git at git.haskell.org git at git.haskell.org
Mon Feb 20 21:19:09 UTC 2017


Repository : ssh://git@git.haskell.org/time

On branches: format-widths,master,posix-perf,tasty
Link       : http://git.haskell.org/packages/time.git/commitdiff/e63859c4c74a12b1a8ce1fc7b67bf0dbef52d8d2

>---------------------------------------------------------------

commit e63859c4c74a12b1a8ce1fc7b67bf0dbef52d8d2
Author: Ashley Yakeley <ashley at yakeley.org>
Date:   Mon Dec 5 23:55:12 2016 -0800

    Get testing working


>---------------------------------------------------------------

e63859c4c74a12b1a8ce1fc7b67bf0dbef52d8d2
 lib/Data/Time/Clock/UTC.hs | 5 ++++-
 stack.yaml                 | 2 +-
 test/Test/TestFormat.hs    | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/Data/Time/Clock/UTC.hs b/lib/Data/Time/Clock/UTC.hs
index 3e27076..27c8bb6 100644
--- a/lib/Data/Time/Clock/UTC.hs
+++ b/lib/Data/Time/Clock/UTC.hs
@@ -15,7 +15,7 @@ module Data.Time.Clock.UTC
     --
     -- If you don't care about leap seconds, use UTCTime and NominalDiffTime for your clock calculations,
     -- and you'll be fine.
-    UTCTime(..),NominalDiffTime
+    UTCTime(..),NominalDiffTime,nominalDay
 ) where
 
 import Control.DeepSeq
@@ -124,3 +124,6 @@ instance RealFrac NominalDiffTime where
 "realToFrac/NominalDiffTime->Pico"       realToFrac = \ (MkNominalDiffTime ps) -> ps
 "realToFrac/Pico->NominalDiffTime"       realToFrac = MkNominalDiffTime
   #-}
+
+nominalDay :: NominalDiffTime
+nominalDay = 86400
diff --git a/stack.yaml b/stack.yaml
index 8957306..e93eb5a 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,4 +1,4 @@
-resolver: lts-7.12
+resolver: lts-6.26
 packages:
 - '.'
 allow-newer: true
diff --git a/test/Test/TestFormat.hs b/test/Test/TestFormat.hs
index 55ca481..bed8ac6 100644
--- a/test/Test/TestFormat.hs
+++ b/test/Test/TestFormat.hs
@@ -48,7 +48,7 @@ baseTime1 :: UTCTime
 baseTime1 = localTimeToUTC utc (LocalTime (fromGregorian 2000 01 01) midnight)
 
 getDay :: Integer -> UTCTime
-getDay day = addUTCTime ((fromInteger day) * posixDayLength) baseTime1
+getDay day = addUTCTime ((fromInteger day) * nominalDay) baseTime1
 
 getYearP1 :: Integer -> UTCTime
 getYearP1 year = localTimeToUTC utc (LocalTime (fromGregorian year 01 01) midnight)



More information about the ghc-commits mailing list