/
UtilsSpec.hs
33 lines (26 loc) · 963 Bytes
/
UtilsSpec.hs
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
27
28
29
30
31
32
33
module Data.Time.UtilsSpec
( spec
) where
import Prelude
import Data.Time.Utils
( utcTimePred, utcTimeSucc )
import Test.Hspec
( Spec, describe, it )
import Test.QuickCheck
( property, withMaxSuccess, (===) )
import Test.Utils.Time
( getUniformTime )
spec :: Spec
spec = describe "Manipulation of time values." $ do
it "utcTimePred . utcTimeSucc == id" $
withMaxSuccess 10000 $ property $ \t ->
utcTimePred (utcTimeSucc (getUniformTime t)) === getUniformTime t
it "utcTimeSucc . utcTimePred == id" $
withMaxSuccess 10000 $ property $ \t ->
utcTimeSucc (utcTimePred (getUniformTime t)) === getUniformTime t
it "utcTimeSucc t > t" $
withMaxSuccess 10000 $ property $ \t ->
utcTimeSucc (getUniformTime t) > getUniformTime t
it "utcTimePred t < t" $
withMaxSuccess 10000 $ property $ \t ->
utcTimePred (getUniformTime t) < getUniformTime t