Ensure that arbitrary DiffTime values are millisecond-bounded
commit614f69ccd032f04d8fcb6bb298b0ffe84a104560
authorBryan O'Sullivan <bos@serpentine.com>
dateMon 18 Nov 2013, 22:26 (13 years ago)
parentf06ed89
tests/Instances.hs+2−1
@@ -40,7 +40,8 @@ instance Arbitrary Day where
4040 arbitrary = ModifiedJulianDay `liftM` arbitrary
4141
4242instance Arbitrary DiffTime where
43− arbitrary = picosecondsToDiffTime `liftM` choose (0, 86400000000000000)
43+ arbitrary = (picosecondsToDiffTime . (* 1000000000)) <$>
44+ choose (0, 86400000)
4445
4546instance Arbitrary UTCTime where
4647 arbitrary = liftM2 UTCTime arbitrary arbitrary