1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
module Test.LocalTime.TimeOfDay (
testTimeOfDay,
) where
import Data.Time.LocalTime.Compat
import Test.Arbitrary ()
import Test.Tasty
import Test.Tasty.QuickCheck hiding (reason)
testTimeOfDay :: TestTree
testTimeOfDay =
testGroup
"TimeOfDay"
[ testProperty "daysAndTimeOfDayToTime . timeToDaysAndTimeOfDay" $ \ndt ->
let
(d, tod) = timeToDaysAndTimeOfDay ndt
ndt' = daysAndTimeOfDayToTime d tod
in
ndt' == ndt
, testProperty "timeOfDayToTime . timeToTimeOfDay" $ \dt ->
let
tod = timeToTimeOfDay dt
dt' = timeOfDayToTime tod
in
dt' == dt
]
|