File: TimeOfDay.hs

package info (click to toggle)
haskell-time-compat 1.9.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 504 kB
  • sloc: haskell: 7,036; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 727 bytes parent folder | download
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
        ]